Add Dockerized Test workflow #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dockerized Test | |
on: [push, pull_request] | |
jobs: | |
dockerized-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
platform: [linux/amd64, linux/arm64] | |
env: | |
DOCKER_IMAGE: cfpq/py_algo:1.0.1 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx and QEMU | |
uses: docker/setup-buildx-action@v1 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Pull Docker image | |
run: docker pull --platform ${{ matrix.platform }} ${{ env.DOCKER_IMAGE }} | |
- name: Run tests in Docker | |
run: | | |
docker run --rm \ | |
--platform ${{ matrix.platform }} \ | |
-v "${{ github.workspace }}:/app" \ | |
${{ env.DOCKER_IMAGE }} -c " | |
echo 'System Info:'; | |
uname -a; | |
pytest test -v -m 'CI'" |