Skip to content

Commit

Permalink
Merge pull request #21 from firefly-cpp/modernize-workflow
Browse files Browse the repository at this point in the history
modernize workflow
  • Loading branch information
firefly-cpp authored Nov 13, 2023
2 parents 68b6fde + 9bb8be3 commit 3abf1cb
Showing 1 changed file with 39 additions and 21 deletions.
60 changes: 39 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: NiaAML-GUI

on:
push:
Expand All @@ -9,27 +9,45 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.9]
os: [ubuntu-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Run tests
run: |
poetry run coverage run --source=niaaml-gui -m unittest discover -b
- name: Publish coverage
run: |
poetry run coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Get full Python version
id: full-python-version
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
- name: Install poetry
run: |
curl -sL https://install.python-poetry.org | python - -y
- name: Update path
if: ${{ matrix.os != 'windows-latest' }}
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Update Windows path
if: ${{ matrix.os == 'windows-latest' }}
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH
- name: Configure poetry
run: poetry config virtualenvs.in-project true
- name: Set up cache
uses: actions/cache@v3
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: timeout 10s poetry run pip --version || rm -rf .venv
- name: Install dependencies
run: poetry install
- name: Run tests
run: poetry run pytest

0 comments on commit 3abf1cb

Please sign in to comment.