Update dependabot.yml #119
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: | |
push: | |
branches: | |
- 'gh-pages' | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
initial_checks: | |
name: Mandatory checks before CI | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check base branch | |
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
if: github.event_name == 'pull_request' | |
with: | |
script: | | |
const skip_label = 'skip-basebranch-check'; | |
const allowed_basebranch = 'gh-pages'; | |
const pr = context.payload.pull_request; | |
if (pr.labels.find(lbl => lbl.name === skip_label)) { | |
core.info(`Base branch check is skipped due to the presence of ${skip_label} label`); | |
return; | |
} | |
if (pr.base.ref !== allowed_basebranch) { | |
core.setFailed(`PR opened against ${pr.base.ref}, not ${allowed_basebranch}`); | |
} else { | |
core.info(`PR opened correctly against ${allowed_basebranch}`); | |
} | |
# The rest only run if above are done | |
tests: | |
runs-on: ubuntu-latest | |
needs: initial_checks | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- name: Set up Python | |
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 | |
with: | |
python-version: '3.x' | |
- name: Install Python dependencies | |
run: python -m pip install wheel pytest | |
- name: Run tests | |
run: pytest tests |