From fa0b4e5cb6c0900d2ce1b006c8331025956630c8 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..4ed950d 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 -v ${{ github.workspace }}:/workspace + run: | + set -o errexit + apk add --no-cache bash less make + cd /workspace + python3 -m pip install -r requirements-dev.txt + make test