Python COG example, plus clean up of text and code (#111) #79
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: CI | |
# On every pull request, but only on push to main | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
pr-target-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fail if target is not staging (for PRs only) | |
if: github.event_name == 'pull_request' | |
run: | | |
if [[ "${{ github.event.pull_request.base.ref }}" != "main" || "${{ github.event.pull_request.head.ref }}" == "staging" ]]; then | |
echo "Target branch is acceptable." | |
else | |
echo "Only PRs from staging can target main." | |
exit 1 | |
fi | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11 | |
- name: Run pre-commit | |
run: | | |
python -m pip install pre-commit | |
pre-commit run --all-files |