-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (84 loc) · 3.1 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
---
name: CI
on: [pull_request]
jobs:
build:
name: CI
runs-on: ubuntu-latest
steps:
- name: Environment debug
run: |
env
- name: Check out code into the Go module directory
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with:
token: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
ref: ${{ github.head_ref }}
- name: Sync Dependencies
run: bazel run //:vendor
if: (github.actor == 'dependabot-preview[bot]') || (github.actor == 'renovate[bot]')
- name: autocommit
uses: stefanzweifel/[email protected]
with:
commit_message: Apply syncdeps changes
branch: ${{ github.head_ref }}
file_pattern: 'vendor/*'
add_options: '--force'
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
if: (github.actor == 'dependabot-preview[bot]') || (github.actor == 'renovate[bot]')
- name: Install playwright browsers
run: npx playwright install --with-deps
- name: Cache Bazel
uses: actions/cache@v3
with:
path: |
~/.cache/bazel
key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel') }}
restore-keys: |
${{ runner.os }}-bazel-
- name: Test
run: |
# build and run unit tests with coverage reporting
# running everything from the coverage command because our nextjs embedding is slow and doesn't
# have proper build artifact detection so it always re-runs, so this is faster than multiple
# bazel commands in CI
bazel coverage //...
echo "coverage_files=$(find bazel-out/ -name 'coverage.dat' -printf '%p, ' | sed 's/, $//')" >> $GITHUB_ENV
- name: Detected Coverage Files
run: echo ${{ env.coverage_files }}
- uses: codecov/codecov-action@v4
name: codecov upload
with:
files: ${{ env.coverage_files }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: setup-syft
run: |
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | \
sh -s -- -b /usr/local/bin v0.32.0
- name: dry run goreleaser
uses: goreleaser/goreleaser-action@master
env:
POWERSHELL_TELEMETRY_OPTOUT: true
with:
version: latest
args: release --snapshot --skip-publish
- uses: actions/upload-artifact@v3
with:
name: vbs-snapshot-macos
path: bazel-bin/bdist/vbs_darwin_amd64/vbs
- uses: actions/upload-artifact@v3
with:
name: vbs-snapshot-macos-m1
path: bazel-bin/bdist/vbs_darwin_arm64/vbs
- uses: actions/upload-artifact@v3
with:
name: vbs-snapshot-windows
path: bazel-bin/bdist/vbs_windows_amd64/vbs.exe
- uses: actions/upload-artifact@v3
with:
name: vbs-snapshot-linux
path: bazel-bin/bdist/vbs_linux_amd64/vbs