Skip to content

Merge pull request #147 from timj/u/timj/add-simonyi #128

Merge pull request #147 from timj/u/timj/add-simonyi

Merge pull request #147 from timj/u/timj/add-simonyi #128

Workflow file for this run

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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.x'
- name: Install Python dependencies
run: python -m pip install wheel pytest
- name: Run tests
run: pytest tests