Add Mauritania holidays #4287
Workflow file for this run
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/CD | |
on: | |
merge_group: | |
branches: | |
- dev | |
- main | |
- v1 | |
pull_request: | |
push: | |
branches-ignore: | |
- gh-readonly-queue/** | |
workflow_dispatch: | |
env: | |
FORCE_COLOR: 1 | |
concurrency: | |
cancel-in-progress: ${{ !contains(fromJSON('["dev", "main", "v1"]'), github.ref_name) }} | |
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | |
jobs: | |
pre-commit: | |
name: Run pre-commit | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
check-latest: true | |
python-version: '3.12' | |
- name: Run pre-commit | |
uses: pre-commit/[email protected] | |
test: | |
name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
needs: | |
- pre-commit | |
strategy: | |
matrix: | |
os: | |
- macos-latest | |
- ubuntu-latest | |
- windows-latest | |
python-version: | |
- '3.8' | |
- '3.9' | |
- '3.10' | |
- '3.11' | |
- '3.12' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
allow-prereleases: true | |
cache: pip | |
cache-dependency-path: | | |
requirements/runtime.txt | |
requirements/tests.txt | |
check-latest: true | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --requirement requirements/tests.txt | |
python -m pip install . | |
- name: Run tests | |
run: | | |
make test | |
- name: Upload coverage to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
build: | |
name: Build distribution | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
cache: pip | |
cache-dependency-path: requirements/runtime.txt | |
check-latest: true | |
python-version: '3.12' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install build polib | |
python -m pip install . | |
- name: Build distribution | |
run: | | |
make package | |
- name: Upload package artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
test-build: | |
name: Test build on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
needs: build | |
strategy: | |
matrix: | |
os: | |
- macos-latest | |
- ubuntu-latest | |
- windows-latest | |
steps: | |
- name: Check out Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
cache: pip | |
cache-dependency-path: | | |
requirements/runtime.txt | |
requirements/tests.txt | |
check-latest: true | |
python-version: '3.12' | |
- name: Get package artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Run tests | |
shell: bash | |
run: | | |
rm -rf holidays | |
python -m pip install --requirement requirements/tests.txt | |
python -m pip install `ls dist/*.whl` | |
pytest --dist loadscope --numprocesses auto tests/countries tests/financial | |
python -m pip uninstall -y holidays python-dateutil six | |
python -m pip install `ls dist/*.tar.gz` | |
pytest --dist loadscope --numprocesses auto tests/countries tests/financial | |
publish-pypi-main: | |
name: Publish to PyPI | |
if: | | |
github.repository == 'vacanza/python-holidays' && | |
github.event_name == 'push' && | |
startsWith(github.event.ref, 'refs/tags/v') | |
environment: main | |
needs: | |
- test-build | |
permissions: | |
id-token: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get package artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |