-
Notifications
You must be signed in to change notification settings - Fork 60
81 lines (76 loc) · 2.27 KB
/
ci.yml
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
name: GitHub CI
on:
pull_request:
push:
schedule:
- cron: 0 0 * * 0
defaults:
run:
shell: 'bash -Eeuo pipefail -x {0}'
jobs:
build-matrix:
strategy:
matrix:
os:
- ubuntu-24.04
- ubuntu-22.04
- ubuntu-20.04
- windows-2025
- windows-2022
- windows-2019
name: Build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./ # test our "action.yml" 👀
- name: Smoke Test
run: |
image='https://github.com/docker-library/official-images/raw/master/library/hello-world'
bashbrew list "$image"
bashbrew list --uniq "$image"
bashbrew cat "$image"
bashbrew from --uniq "$image"
"$BASHBREW_SCRIPTS/bashbrew-host-arch.sh" # should print "amd64" or "windows-amd64"
arm32v7="$("$BASHBREW_SCRIPTS/bashbrew-arch-to-goenv.sh" arm32v7)"
eval "$arm32v7"
test "$GOARM" = '7'
go-test:
name: Go Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Go Test
run: |
docker build --pull --file Dockerfile.test --tag test .
docker run --rm test cat coverage.out > coverage.out
# TODO find a suitable codecov solution that doesn't require privileged access to the org/repo
#- name: Codecov
# uses: codecov/codecov-action@v3
# with:
# files: coverage.out
# fail_ci_if_error: true
# verbose: true
# in the meantime, upload coverage to GHA
- run: docker run --rm -i test go tool cover -html /dev/stdin -o /dev/stdout < coverage.out > coverage.html
- uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.*
include-hidden-files: true
if-no-files-found: error
dockerfile:
name: Test Dockerfile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Dockerfile
run: |
docker build --pull .
dockerfile-release:
name: Test Dockerfile.release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Dockerfile.release
run: |
docker build --pull --file Dockerfile.release .