ci: run unit tests in docker

- run separate unit-test job
- build docker
- allow make docker-unit-tests in ci
This commit is contained in:
André Roth
2026-01-11 18:19:42 +01:00
parent 1e7c15b69b
commit a57e2aecd7
2 changed files with 41 additions and 27 deletions

View File

@@ -17,6 +17,29 @@ env:
DEBIAN_FRONTEND: noninteractive
jobs:
unit-test:
name: "Unit Tests (Debian 13)"
runs-on: ubuntu-22.04
continue-on-error: false
timeout-minutes: 30
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4
with:
# fetch the whole repo for `git describe` to work
fetch-depth: 0
- name: "Docker Image"
run: |
make docker-image
- name: "Unit Test"
run: |
make docker-unit-tests
- name: "Upload Code Coverage"
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: unit.out
test:
name: "Test (Ubuntu 22.04)"
runs-on: ubuntu-22.04
@@ -63,18 +86,6 @@ jobs:
with:
directory: ${{ runner.temp }}
- name: "Run Unit Tests"
env:
RUN_LONG_TESTS: 'yes'
AZURE_STORAGE_ENDPOINT: "http://127.0.0.1:10000/devstoreaccount1"
AZURE_STORAGE_ACCOUNT: "devstoreaccount1"
AZURE_STORAGE_ACCESS_KEY: "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
sudo mkdir -p /srv ; sudo chown runner /srv
COVERAGE_DIR=${{ runner.temp }} make test
- name: "Run Benchmark"
run: |
COVERAGE_DIR=${{ runner.temp }} make bench
@@ -94,7 +105,7 @@ jobs:
- name: "Merge Code Coverage"
run: |
go install github.com/wadey/gocovmerge@v0.0.0-20160331181800-b5bfa59ec0ad
~/go/bin/gocovmerge unit.out ${{ runner.temp }}/*.out > coverage.txt
~/go/bin/gocovmerge ${{ runner.temp }}/*.out > coverage.txt
- name: "Upload Code Coverage"
uses: codecov/codecov-action@v2
@@ -104,7 +115,8 @@ jobs:
ci-debian-build:
name: "Build"
needs: test
needs:
- test
runs-on: ubuntu-latest
strategy:
fail-fast: false
@@ -224,7 +236,9 @@ jobs:
ci-binary-build:
name: "Build"
needs: test
needs:
- unit-test
- test
runs-on: ubuntu-latest
strategy:
matrix: