-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: implement ci workflow and basic tests (#1)
- Loading branch information
1 parent
b0105b2
commit c179eea
Showing
5 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: [master] | ||
types: [opened, synchronize, reopened] | ||
push: | ||
branches: [master] | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pytest: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- macos-11 | ||
- macos-12 | ||
- windows-2019 | ||
- windows-2022 | ||
- ubuntu-20.04 | ||
- ubuntu-22.04 | ||
python: ["2.7", "3.8", "3.9", "3.10", "3.11"] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Python | ||
id: python | ||
uses: ./ | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Install Python Dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install --upgrade -r requirements-dev.txt | ||
- name: Test with pytest | ||
id: test | ||
env: | ||
INPUT_PYTHON_VERSION: ${{ matrix.python }} | ||
shell: bash | ||
run: | | ||
python -m pytest \ | ||
-rxXs \ | ||
--tb=native \ | ||
--verbose \ | ||
tests |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pytest==4.6.11;python_version<"3.5" | ||
pytest==6.1.2;python_version>="3.5" and python_version<"3.6" | ||
pytest==7.0.1;python_version>="3.6" and python_version<"3.7" | ||
pytest==7.4.2;python_version>="3.7" |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# -*- coding: utf-8 -*- | ||
# standard imports | ||
import os | ||
|
||
# lib imports | ||
import pytest | ||
|
||
|
||
@pytest.fixture(scope='session') | ||
def input_python_version(): | ||
return os.environ.get('INPUT_PYTHON_VERSION') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# -*- coding: utf-8 -*- | ||
# standard imports | ||
import platform | ||
import sys | ||
|
||
|
||
def test_python_platform_version(input_python_version): | ||
assert platform.python_version().startswith(input_python_version) | ||
|
||
|
||
def test_python_system_version(input_python_version): | ||
assert sys.version.startswith(input_python_version) |