Skip to content

Commit

Permalink
Update ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p committed Aug 21, 2021
1 parent 2052d0a commit a0f8174
Showing 1 changed file with 44 additions and 2 deletions.
46 changes: 44 additions & 2 deletions .github/workflows/ci.yaml
Expand Up @@ -72,8 +72,8 @@ jobs:
. venv/bin/activate
pre-commit install --install-hooks
formatting:
name: Run pre-commit checks
pylint:
name: Run pylint check
runs-on: ubuntu-latest
needs: prepare-base
steps:
Expand Down Expand Up @@ -114,6 +114,48 @@ jobs:
pip install -e .
pre-commit run pylint --all-files
mypy:
name: Run mypy check
runs-on: ubuntu-latest
needs: prepare-base
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2.3.4
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v2.1.6
with:
path: venv
key:
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.prepare-base.outputs.python-key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python venv from cache"
exit 1
- name: Restore pre-commit environment
id: cache-precommit
uses: actions/cache@v2.1.6
with:
path: ${{ env.PRE_COMMIT_CACHE }}
key: ${{ runner.os }}-${{ needs.prepare-base.outputs.pre-commit-key }}
- name: Fail job if pre-commit cache restore failed
if: steps.cache-precommit.outputs.cache-hit != 'true'
run: |
echo "Failed to restore pre-commit environment from cache"
exit 1
- name: Run formatting check
run: |
. venv/bin/activate
pip install -e .
pre-commit run mypy --all-files
spelling:
name: Run spelling checks
runs-on: ubuntu-latest
Expand Down

0 comments on commit a0f8174

Please sign in to comment.