fix syntax error in publish action #17
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
name: Build | ||
on: | ||
push: | ||
branches: [ main ] | ||
jobs: | ||
unittests: | ||
needs: update-requirements | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.7.6, 3.8, 3.9] | ||
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 Poetry | ||
uses: snok/[email protected] | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
# load cached venv if cache exists | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
- name: Install dependencies and run | ||
run: | | ||
poetry install --no-interaction | ||
poetry run python -m unittest | ||
update-outputs: | ||
needs: unittests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- if: ${{ matrix.python-version == '3.9' }} | ||
run: | | ||
find tests -name output -exec git add --force {} \; | ||
if [[ ! -z $(git status -s tests) ]] | ||
then | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git commit -m 'Automated adding outputs from tests' tests | ||
git push | ||
fi |