Skip to content

[pre-commit.ci] pre-commit autoupdate (#64) #280

[pre-commit.ci] pre-commit autoupdate (#64)

[pre-commit.ci] pre-commit autoupdate (#64) #280

Workflow file for this run

name: CI
on:
push:
branches:
- main
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@v3
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.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:
needs: [initial_checks]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
setenv: |
ARCH_ON_CI: "normal"
IS_CRON: "false"
submodules: false
coverage: ""
libraries: |
apt:
- language-pack-fr
- tzdata
envs: |
- name: Python 3.10 with minimal dependencies and full coverage
linux: py310-test-cov
coverage: codecov
- name: Python 3.11 with minimal dependencies and full coverage
linux: py311-test-cov
coverage: codecov
- name: Python 3.11 with all optional dependencies
linux: py311-test-alldeps
libraries:
apt:
- language-pack-fr
- tzdata
toxargs: -v --develop
- name: Python 3.8 with oldest supported version of all dependencies
linux: py38-test-oldestdeps-alldeps-cov
coverage: codecov
- name: Python 3.10 with all optional dependencies (Windows)
windows: py310-test-alldeps
posargs: --durations=50
- name: Python 3.10 with all optional dependencies (MacOS X)
macos: py310-test-alldeps
posargs: --durations=50
test_pure_wheel_building:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1
if: (github.event_name == 'push' || github.event_name == 'pull_request')
needs: initial_checks
with:
upload_to_pypi: false
repository_url: https://test.pypi.org/legacy/
upload_to_anaconda: false
test_extras: test
test_command: pytest $GITHUB_WORKSPACE/tests $GITHUB_WORKSPACE/docs
secrets:
pypi_token: ${{ secrets.TEST_PYPI_API_TOKEN }}
# FIXME! use OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v1
test_wheel_building:
# This ensures that a couple of targets work fine in pull requests and pushes
name: mypyc wheels (${{ matrix.name }})
if: (github.event_name == 'push' || github.event_name == 'pull_request')
needs: initial_checks
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-latest
name: linux-x86_64
steps:
- uses: actions/checkout@v3
- name: Build wheels via cibuildwheel
uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: "${{ matrix.macos_arch }}"
# This isn't supported in pyproject.toml which makes sense (but is annoying).
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8"
- name: Upload wheels as workflow artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.name }}-mypyc-wheels
path: ./wheelhouse/*.whl