From d18983d9a6d729b78b7d81a37905824bfc5690ea Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Mon, 22 May 2023 18:01:21 +0200 Subject: [PATCH] add github workflow to build & test, exporting a coverage file --- .github/workflows/build-test.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/build-test.yml diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 0000000..69f6c51 --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,22 @@ +name: Build and test + +on: [push, pull_request, workflow_dispatch] + +jobs: + build-test: + runs-on: ubuntu-latest + strategy: + max-parallel: 1 # cannot run tests concurrently, files are created + matrix: + go-version: ['stable', 'oldstable'] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + - run: make build + # Need to run tests with a temp dir on same file system for os.Rename to succeed. + - run: 'mkdir -p tmp && TMPDIR=$PWD/tmp make test' + - uses: actions/upload-artifact@v3 + with: + path: cover.html