forked from GoogleContainerTools/distroless
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (70 loc) · 2.69 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
name: CI
on:
workflow_dispatch: # Allow manual runs.
pull_request:
branches: [ 'main' ]
push:
branches: [ 'main' ]
permissions:
contents: read
jobs:
ci-build-test:
name: CI build and unit test
runs-on: ubuntu-20.04 # most compatible with debian 11
steps:
- uses: actions/checkout@v3
- name: Mount bazel caches
uses: actions/cache@v3
with:
path: |
~/.cache/bazel-repo
key: bazel-cache-deps-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', '**/*.yaml', 'WORKSPACE') }}-${{ github.sha }}
restore-keys: |
bazel-cache-deps-
- name: Free space
run: |
sudo apt-get remove -y '^dotnet-.*'
sudo apt-get remove -y '^llvm-.*'
sudo apt-get remove -y 'php.*'
sudo apt-get remove -y azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel
sudo apt-get autoremove -y
sudo apt-get clean
rm -rf /usr/share/dotnet/
- name: Fetch
run: |
for i in $(seq 5); do
bazel --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc fetch //... && break || sleep 20;
done
- name: Build All Images
run: bazel --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc build $(bazel query 'kind(oci_image, deps(:sign_and_push))')
- name: Unit Tests
run: bazel --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc test //... --build_tests_only
ci-images:
name: CI image tests
runs-on: ubuntu-20.04 # most compatible with debian 11
steps:
- uses: actions/checkout@v3
- name: Mount bazel caches
uses: actions/cache@v3
with:
path: |
~/.cache/bazel-repo
key: bazel-cache-deps-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', '**/*.yaml', 'WORKSPACE') }}-${{ github.sha }}
restore-keys: |
bazel-cache-deps-
- name: Free space
run: |
sudo apt-get remove -y '^dotnet-.*'
sudo apt-get remove -y '^llvm-.*'
sudo apt-get remove -y 'php.*'
sudo apt-get remove -y azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel
sudo apt-get autoremove -y
sudo apt-get clean
rm -rf /usr/share/dotnet/
- name: Fetch
run: |
for i in $(seq 5); do
bazel --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc fetch $(bazel query 'attr(tags, "amd64", ...)') && break || sleep 20;
done
- name: Image Tests
run: bazel --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc test $(bazel query 'attr(tags, "amd64", ...)')