Skip to content

Commit 200eb90

Browse files
committed
Add Dockerized Test workflow
1 parent 36f2dfc commit 200eb90

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Dockerized Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
dockerized-test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
platform: [linux/amd64, linux/arm64]
11+
env:
12+
DOCKER_IMAGE: cfpq/py_algo:1.0.1
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v3
19+
20+
- name: Set up QEMU
21+
uses: docker/setup-qemu-action@v3
22+
23+
- name: Pull Docker image
24+
run: docker pull --platform ${{ matrix.platform }} ${{ env.DOCKER_IMAGE }}
25+
26+
- name: Run tests in Docker
27+
run: |
28+
docker run --rm \
29+
--platform ${{ matrix.platform }} \
30+
-v "${{ github.workspace }}:/app" \
31+
${{ env.DOCKER_IMAGE }} -c "
32+
echo 'System Info:';
33+
uname -a;
34+
pytest test -v -m 'CI'"

0 commit comments

Comments
 (0)