[pre-commit.ci] pre-commit autoupdate (#100) #408
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: | |
- main | |
- 'v*' | |
tags: | |
- '*' | |
pull_request: | |
permissions: | |
contents: read | |
env: | |
ARCH_ON_CI: "normal" | |
IS_CRON: "false" | |
jobs: | |
initial_checks: | |
name: Mandatory checks before CI | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check base branch | |
uses: actions/github-script@v7 | |
if: github.event_name == 'pull_request' | |
with: | |
script: | | |
const skip_label = 'skip-basebranch-check'; | |
const { default_branch: allowed_basebranch } = context.payload.repository; | |
const pr = context.payload.pull_request; | |
if (pr.user.login === 'meeseeksmachine') { | |
core.info(`Base branch check is skipped since this is auto-backport by ${pr.user.login}`); | |
return; | |
} | |
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}`); | |
} | |
tests: | |
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 | |
needs: initial_checks | |
with: | |
envs: | | |
# Standard tests | |
- linux: py310-test-cov | |
- linux: py312-test-cov | |
# All deps tests | |
- linux: py311-test-alldeps | |
toxargs: '-v --develop' | |
- linux: py39-test-oldestdeps-alldeps-cov-clocale | |
# Platform test | |
- windows: py311-test-alldeps | |
# - macos: py311-test-alldeps # TODO: https://github.com/OpenAstronomy/github-actions-workflows/issues/197 | |
conda: true | |
coverage: codecov | |
fail-fast: true | |
secrets: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
wheels_tests: | |
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1 | |
needs: initial_checks | |
permissions: | |
contents: none | |
with: | |
upload_to_pypi: false | |
upload_to_anaconda: false | |
test_extras: test | |
test_command: pytest $GITHUB_WORKSPACE/tests $GITHUB_WORKSPACE/docs -p no:warnings |