add a Github action to run all the pre-commit checks #10
Workflow file for this run
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: Pull Request | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
validate-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@master | |
- name: Extract dependent Pull Requests | |
uses: depends-on/depends-on-action@main | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run pre-commit checks | |
run: | | |
set -ex | |
curl -sSL https://install.python-poetry.org | python3 - | |
poetry install --with test | |
poetry run pre-commit run -a || git diff && exit 1 | |
check-all-dependencies-are-merged: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@master | |
- name: Check all dependent Pull Requests are merged | |
uses: depends-on/depends-on-action@main | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
check-unmerged-pr: true | |
... |