-
Notifications
You must be signed in to change notification settings - Fork 4
89 lines (81 loc) · 2.33 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: continuous-integration
on:
pull_request:
branches:
- '*'
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
SHELL: /bin/bash
defaults:
run:
shell: bash
jobs:
trufflehog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: TruffleHog OSS
uses: trufflesecurity/[email protected]
with:
path: ./
base: ${{ github.event.repository.default_branch }}
head: HEAD
extra_args: --debug --only-verified
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: stable
cache: false
- run: go install golang.org/x/tools/cmd/goimports@latest
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
- uses: pre-commit/[email protected]
test-vroom:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: stable
cache: false
- run: make test
publish-to-dockerhub:
name: Publish Vroom to DockerHub
runs-on: ubuntu-20.04
if: ${{ (github.ref_name == 'main') }}
steps:
- uses: actions/checkout@v3
- timeout-minutes: 20
run: until docker pull "us.gcr.io/sentryio/vroom:${{ github.sha }}" 2>/dev/null; do sleep 10; done
- name: Push built docker image
shell: bash
run: |
IMAGE_URL="us.gcr.io/sentryio/vroom:${{ github.sha }}"
docker login --username=sentrybuilder --password ${{ secrets.DOCKER_HUB_RW_TOKEN }}
# We push 3 tags to Dockerhub:
# first, the full sha of the commit
docker tag "$IMAGE_URL" getsentry/vroom:${GITHUB_SHA}
docker push getsentry/vroom:${GITHUB_SHA}
# second, the short sha of the commit
SHORT_SHA=$(git rev-parse --short "$GITHUB_SHA")
docker tag "$IMAGE_URL" getsentry/vroom:${SHORT_SHA}
docker push getsentry/vroom:${SHORT_SHA}
# finally, nightly
docker tag "$IMAGE_URL" getsentry/vroom:nightly
docker push getsentry/vroom:nightly