Skip to content

Commit d324e93

Browse files
committed
chore: init examples CI test action
1 parent ae3a427 commit d324e93

File tree

3 files changed

+69
-4
lines changed

3 files changed

+69
-4
lines changed

.github/workflows/tests.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Examples Test
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- '*.x'
7+
paths-ignore:
8+
- '*.md'
9+
pull_request:
10+
paths-ignore:
11+
- '*.md'
12+
jobs:
13+
local-test:
14+
name: Local-Ubuntu20.04-Python${{ matrix.python }}
15+
runs-on: ubuntu-20.04
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- {python: '3.12'}
21+
- {python: '3.11'}
22+
- {python: '3.10'}
23+
- {python: '3.9'}
24+
- {python: '3.8'}
25+
steps:
26+
- name: Checkout Code Repository
27+
uses: actions/checkout@v4
28+
29+
- name: Install GCC and Make
30+
run: |
31+
sudo apt-get update
32+
sudo apt-get install -y build-essential
33+
34+
- name: Set up Python
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: ${{ matrix.python }}
38+
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
pip install poetry
43+
poetry install --with dev
44+
45+
- name: Run Examples Test
46+
run: poetry run pytest -vs -n auto
47+
48+
container-test:
49+
name: GCC Docker Container
50+
runs-on: ubuntu-latest
51+
container:
52+
image: gcc:latest
53+
volumes:
54+
- ${{ github.workspace }}:/app
55+
steps:
56+
- name: Set up Python Package
57+
run: |
58+
apt-get update
59+
apt-get install -y python3-pip
60+
pip install -r requirements/build.txt --break-system-packages
61+
pip install -r requirements/tests.txt --break-system-packages
62+
pip install . --break-system-packages
63+
64+
- name: Run test in Docker
65+
run: pytest -vs -n auto

requirements/build.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
objprint==0.2.3 ; python_version >= "3.8" and python_version < "4.0"
2+
pexpect==4.9.0 ; python_version >= "3.8" and python_version < "4.0"
3+
ptyprocess==0.7.0 ; python_version >= "3.8" and python_version < "4.0"
4+
toml==0.10.2 ; python_version >= "3.8" and python_version < "4.0"

requirements.txt renamed to requirements/tests.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,9 @@ exceptiongroup==1.2.2 ; python_version >= "3.8" and python_version < "3.11"
33
execnet==2.1.1 ; python_version >= "3.8" and python_version < "4.0"
44
iniconfig==2.0.0 ; python_version >= "3.8" and python_version < "4.0"
55
mpmath==1.3.0 ; python_version >= "3.8" and python_version < "4.0"
6-
objprint==0.2.3 ; python_version >= "3.8" and python_version < "4.0"
76
packaging==24.1 ; python_version >= "3.8" and python_version < "4.0"
8-
pexpect==4.9.0 ; python_version >= "3.8" and python_version < "4.0"
97
pluggy==1.5.0 ; python_version >= "3.8" and python_version < "4.0"
10-
ptyprocess==0.7.0 ; python_version >= "3.8" and python_version < "4.0"
118
pytest-xdist==3.6.1 ; python_version >= "3.8" and python_version < "4.0"
129
pytest==8.3.2 ; python_version >= "3.8" and python_version < "4.0"
1310
sympy==1.13.1 ; python_version >= "3.8" and python_version < "4.0"
14-
toml==0.10.2 ; python_version >= "3.8" and python_version < "4.0"
1511
tomli==2.0.1 ; python_version >= "3.8" and python_version < "3.11"

0 commit comments

Comments
 (0)