From da18aec4d69049a7bc8f4d74a5159cf226841d1c Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Fri, 21 Jun 2024 18:55:00 +0000 Subject: [PATCH] Use docker instances to run tests --- .github/workflows/test.yml | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec04495..5c863fe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,14 +21,11 @@ concurrency: jobs: tests: - name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}" - runs-on: "${{ matrix.os }}" + name: "Python ${{ matrix.python-version }}" + runs-on: ubuntu-latest strategy: matrix: - os: - - ubuntu-latest - - macos-latest python-version: # Available versions: # https://github.com/actions/python-versions/blob/main/versions-manifest.json @@ -43,15 +40,14 @@ jobs: - name: "Check out the repo" uses: "actions/checkout@v3" - - name: "Set up Python" - uses: "actions/setup-python@v4" + - name: "Run tests in Docker" + uses: "addnab/docker-run-action@v3" with: - python-version: "${{ matrix.python-version }}" - - - name: "Install dependencies" - run: | - python3 -VV - python3 -m pip install -r requirements-dev.txt - - name: "Run tests" - run: | - make test + image: "python:${{ matrix.python-version }}-alpine" + options: --rm + run: | + set -o errexit + python3 -m pip install -r requirements-dev.txt + apt update -y + apt install -y make + make -C ${{ github.workspace }} test