Skip to content

Commit

Permalink
chore: init examples test action
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanlinjui committed Aug 7, 2024
1 parent 60e2795 commit dc91f2d
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Examples Test
on:
push:
branches:
- main
- '*.x'
paths-ignore:
- '*.md'
pull_request:
paths-ignore:
- '*.md'
jobs:
local-tests:
name: Local-Ubuntu20.04-Python${{ matrix.python }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- {python: '3.13'}
- {python: '3.12'}
- {python: '3.11'}
- {python: '3.10'}
- {python: '3.9'}
- {python: '3.8'}
steps:
- name: Checkout Code Repository
uses: actions/checkout@v4

- name: Install GCC and Make
run: sudo apt-get update && sudo apt-get install -y build-essential

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: requirements.txt

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Tests
run: pytest -vs -n auto

container-tests:
name: Container gcc Docker image Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Code Repository
uses: actions/checkout@v4

- name: Set up Docker
run: |
docker pull gcc:latest
- name: Run tests in Docker
run: |
docker run --rm \
-v ${{ github.workspace }}:/app \
-w /app \
gcc:latest \
sh -c "pip install -r requirements.txt && pytest -vs -n auto"
15 changes: 15 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
colorama==0.4.6 ; python_version >= "3.8" and python_version < "4.0" and sys_platform == "win32"
exceptiongroup==1.2.2 ; python_version >= "3.8" and python_version < "3.11"
execnet==2.1.1 ; python_version >= "3.8" and python_version < "4.0"
iniconfig==2.0.0 ; python_version >= "3.8" and python_version < "4.0"
mpmath==1.3.0 ; python_version >= "3.8" and python_version < "4.0"
objprint==0.2.3 ; python_version >= "3.8" and python_version < "4.0"
packaging==24.1 ; python_version >= "3.8" and python_version < "4.0"
pexpect==4.9.0 ; python_version >= "3.8" and python_version < "4.0"
pluggy==1.5.0 ; python_version >= "3.8" and python_version < "4.0"
ptyprocess==0.7.0 ; python_version >= "3.8" and python_version < "4.0"
pytest-xdist==3.6.1 ; python_version >= "3.8" and python_version < "4.0"
pytest==8.3.2 ; python_version >= "3.8" and python_version < "4.0"
sympy==1.13.1 ; python_version >= "3.8" and python_version < "4.0"
toml==0.10.2 ; python_version >= "3.8" and python_version < "4.0"
tomli==2.0.1 ; python_version >= "3.8" and python_version < "3.11"

0 comments on commit dc91f2d

Please sign in to comment.