imagorvideoextended/.github/workflows/test.yml
Adrian Shum 45f9255112
build: debian trixie, CI/CD refactor (#107)
* debian trixie

* run tests in docker

* cleanup

* test: reset golden

* test: update golden files

---------

Co-authored-by: cshum <293790+cshum@users.noreply.github.com>
2025-08-30 11:38:36 +08:00

52 lines
1.3 KiB
YAML

name: test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
name: Docker Test
runs-on: ubuntu-24.04
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build test image
run: |
docker build --target builder -t imagorvideo-test .
- name: Run tests in Docker
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
imagorvideo-test \
go test ./... -v
- name: Commit golden files
if: github.event_name == 'pull_request'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "test: update golden files"
file_pattern: "testdata/golden"
- name: Run coverage in Docker
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
imagorvideo-test \
sh -c "rm -rf examples cmd && go test -coverprofile=profile.cov ./..."
- name: Coveralls
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov