fix: Combine jobs to allow for docker usage
Some checks failed
ci / docker-build-and-test (pull_request) Failing after 35s

This commit is contained in:
Brock Allen
2024-03-04 06:34:30 +00:00
parent e56b5ac666
commit 4d7e2bc57c

View File

@@ -11,7 +11,7 @@ on:
# https://docs.docker.com/build/ci/github-actions/share-image-jobs/
# just using caches instead of artifact upload.
jobs:
docker-build:
docker-build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@@ -52,28 +52,6 @@ jobs:
name: ${{ runner.os }}-docker-${{ steps.dockerfile-hash.outputs.hash }}
path: /tmp/docker/${{ runner.os }}-builder-image.tar
retention-days: 3
build-and-test:
runs-on: ubuntu-latest
needs: docker-build
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: actions/setup-go@v3
with:
go-version: '1.20'
-
name: Hash dockerfile
id: dockerfile-hash
uses: https://gitea.com/actions/go-hashfiles@v0.0.1
with:
patterns: builder.Dockerfile
-
name: Download docker image
uses: actions/download-artifact@v3
with:
name: ${{ runner.os }}-docker-${{ steps.dockerfile-hash.outputs.hash }}
path: /tmp/docker/${{ runner.os }}-builder-image.tar
-
name: Build library
uses: https://git.brocklobsta.net/brock/docker-run-action@v5
@@ -108,5 +86,3 @@ jobs:
name: reports-${{github.run_number}}
path: ${{ env.ASSET }}
retention-days: 3
# TODO: delete cache on merge.