-
Notifications
You must be signed in to change notification settings - Fork 4
28 lines (23 loc) · 953 Bytes
/
main.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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: bazelbuild/setup-bazelisk@v1
# Setup Credential Helper to authenticate to Github Container Registry
- run: echo '{"credHelpers":{"ghcr.io":"ghcr"}}' > ~/.docker/config.json
- run: echo "${HOME}/.local/bin" >> $GITHUB_PATH
- run: mkdir -p ~/.local/bin
- run: echo -e "#!/usr/bin/env bash\n echo '{\"ServerURL\":\"ghcr.io\",\"Username\":\"Bearer\",\"Secret\":\"${{ secrets.GITHUB_TOKEN }}\"}'" > ~/.local/bin/docker-credential-ghcr
- run: chmod +x ~/.local/bin/docker-credential-ghcr
# Setup local toolchain
- run: bazel build --config=ci //go/cmd/ocitool:ocitool && cp bazel-bin/go/cmd/ocitool/ocitool_/ocitool bin/ocitool-linux-amd64
# Run all tests
- run: bazel test --config=ci //...