Skip to content

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

[pre-commit.ci] pre-commit autoupdate

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

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:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
needs: initial_checks
strategy:
fail-fast: true
matrix:
include:
- name: Python 3.11 with minimal dependencies and full coverage
os: ubuntu-latest
python: '3.11'
toxenv: py311-test-cov
- name: Python 3.10 with all optional dependencies
os: ubuntu-latest
python: '3.10'
toxenv: py310-test-alldeps
toxargs: -v --develop
- name: Python 3.9 with oldest supported version of all dependencies
os: ubuntu-20.04
python: '3.9'
toxenv: py39-test-oldestdeps-alldeps-cov-clocale
- name: Python 3.10 with all optional dependencies (Windows)
os: windows-latest
python: '3.10'
toxenv: py310-test-alldeps
toxposargs: --durations=50
- name: Python 3.10 with all optional dependencies (MacOS X)
os: macos-latest
python: '3.10'
toxenv: py310-test-alldeps
toxposargs: --durations=50
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install language-pack-fr and tzdata
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install language-pack-fr tzdata
- name: Install Python dependencies
run: python -m pip install --upgrade tox codecov
- name: Run tests
run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}
- name: Upload coverage to codecov
if: ${{ contains(matrix.toxenv,'-cov') }}
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml