ci: publish to conda #76
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: Validate | |
on: | |
pull_request: | |
types: [ assigned, opened, reopened, synchronize, ready_for_review ] | |
workflow_call: | |
jobs: | |
build: | |
uses: "./.github/workflows/build.yml" | |
lint-files: | |
runs-on: ubuntu-22.04 | |
needs: [ build ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Tox | |
run: pipx install tox | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9.12 | |
- name: Lint files | |
run: tox -r -e lint | |
test-yaml: | |
runs-on: ubuntu-22.04 | |
needs: [ build ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Tox | |
run: pipx install tox | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9.12 | |
- name: Test files | |
run: tox -r -e py39 | |
test-dist: | |
runs-on: ubuntu-22.04 | |
needs: [ build ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9.12 | |
- name: Restore built package | |
uses: actions/cache@v4 | |
with: | |
path: dist | |
key: release-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} | |
- name: Test the built package | |
run: | | |
pip install twine | |
twine check dist/* | |
test-conda: | |
runs-on: ubuntu-22.04 | |
needs: [ build ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
activate-environment: openfisca | |
miniforge-version: latest | |
python-version: 3.9.12 | |
use-mamba: true | |
- name: Restore build | |
uses: actions/cache@v4 | |
with: | |
path: /tmp/conda-bld | |
key: build-conda-${{ hashFiles('.conda/recipe.yaml') }}-${{ github.sha }} | |
- name: Install package | |
shell: bash -l {0} | |
run: mamba install --channel file:///tmp/conda-bld --channel openfisca openfisca-country_template | |
- name: Test conda package | |
shell: bash -l {0} | |
run: openfisca test openfisca_country_template/tests | |
test-api: | |
runs-on: ubuntu-22.04 | |
needs: [ build ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9.12 | |
- name: Restore build | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.pythonLocation }} | |
key: build-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} | |
- name: Test the Web API | |
run: "${GITHUB_WORKSPACE}/.github/test-api.sh" | |
check-version-and-changelog: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all the tags | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9.12 | |
- name: Check version number has been properly updated | |
run: "${GITHUB_WORKSPACE}/.github/is-version-number-acceptable.sh" |