80 lines
2.2 KiB
YAML
80 lines
2.2 KiB
YAML
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
|
|
- windows-2025
|
|
- windows-2022
|
|
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 .
|