forked from IDSIA/sacred
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use GitHub Actions for tests (IDSIA#896)
* Use GitHub Actions for testing * Add fail-fast: false * Use strings for python version numbers and tox commands * Use separate jobs for coverage and setup tests * Update build badge * Remove azure-pipelines.yml * Change trigger to push As recommended in https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
- Loading branch information
Showing
4 changed files
with
118 additions
and
196 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,113 @@ | ||
name: Tests | ||
|
||
on: | ||
- push | ||
|
||
jobs: | ||
pytest: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# These tests run on all os versions | ||
env: [ | ||
{python: '3.8', tox: 'py38'}, | ||
{python: '3.9', tox: 'py39'}, | ||
{python: '3.10', tox: 'py310'}, | ||
{python: '3.11', tox: 'py311'}, | ||
] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
||
# These tests only run on ubuntu | ||
include: | ||
- os: ubuntu-latest | ||
env: | ||
python: '3.8' | ||
tox: 'tensorflow-27' | ||
- os: ubuntu-latest | ||
env: | ||
python: '3.9' | ||
tox: 'tensorflow-28' | ||
- os: ubuntu-latest | ||
env: | ||
python: '3.10' | ||
tox: 'tensorflow-29' | ||
- os: ubuntu-latest | ||
env: | ||
python: '3.10' | ||
tox: 'tensorflow-210' | ||
- os: ubuntu-latest | ||
env: | ||
python: '3.10' | ||
tox: 'tensorflow-211' | ||
- os: ubuntu-latest | ||
env: | ||
python: '3.9' | ||
tox: 'numpy-120' | ||
- os: ubuntu-latest | ||
env: | ||
python: '3.10' | ||
tox: 'numpy-121' | ||
- os: ubuntu-latest | ||
env: | ||
python: '3.10' | ||
tox: 'numpy-123' | ||
- os: ubuntu-latest | ||
env: | ||
python: '3.11' | ||
tox: 'numpy-124' | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.env.python }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.env.python }} | ||
- name: Install tox | ||
run: | | ||
python -m pip install tox | ||
- name: Test with tox against environments ${{ matrix.env.tox }} | ||
run: python -m tox -e ${{ matrix.env.tox }} | ||
test_pre_commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
- name: Test pre-commit | ||
run: | | ||
bash ./tests/check_pre_commit.sh | ||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
- name: Install tox | ||
run: | | ||
python -m pip install tox | ||
- name: Run coverage tox job | ||
run: python -m tox -e coverage | ||
setup: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest, windows-latest, macos-latest ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
- name: Install tox | ||
run: | | ||
python -m pip install tox | ||
- name: Run setup tox job | ||
run: python -m tox -e setup | ||
|
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
This file was deleted.
Oops, something went wrong.
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