-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (64 loc) · 2.16 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
---
name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build:
name: CI
runs-on: ubuntu-latest
steps:
- name: Install bazelisk
# yamllint disable rule:line-length
run: |
sudo wget -O /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.3.0/bazelisk-linux-amd64
sudo chmod +x /usr/local/bin/bazel
- 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/git-auto-commit-action@v4.16.0
with:
commit_message: Apply syncdeps changes
branch: ${{ github.head_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
if: (github.actor == 'dependabot-preview[bot]') || (github.actor == 'renovate[bot]')
- name: bazel build
run: bazel run :install
- name: Test
run: bazel test //...
- name: Coverage
run: |
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@master
with:
go-version: 1.18.5
- 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@v5
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
with:
version: latest
args: release --snapshot --skip-publish