-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5216c63
commit a779d98
Showing
80 changed files
with
3,440 additions
and
1,648 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: pip | ||
directory: "/" | ||
directory: / | ||
schedule: | ||
interval: monthly | ||
labels: | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: Setup conda | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
os: | ||
required: true | ||
type: string | ||
|
||
numpy: | ||
required: true | ||
type: string | ||
|
||
python: | ||
required: true | ||
type: string | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
jobs: | ||
setup: | ||
runs-on: ${{ inputs.os }} | ||
name: conda-setup-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }} | ||
env: | ||
# To colorize output of make tasks. | ||
TERM: xterm-256color | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache conda env | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
/usr/share/miniconda/envs/openfisca | ||
~/.conda/envs/openfisca | ||
.env.yaml | ||
key: conda-env-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-${{ hashFiles('setup.py') }} | ||
restore-keys: conda-env-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}- | ||
id: cache-env | ||
|
||
- name: Cache conda deps | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/conda_pkgs_dir | ||
key: conda-deps-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-${{ hashFiles('setup.py') }} | ||
restore-keys: conda-deps-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}- | ||
id: cache-deps | ||
|
||
- name: Cache release | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/conda-rel | ||
key: conda-release-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-${{ hashFiles('setup.py') }}-${{ github.sha }} | ||
|
||
- name: Setup conda | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
activate-environment: openfisca | ||
miniforge-version: latest | ||
python-version: ${{ inputs.python }} | ||
use-mamba: true | ||
if: steps.cache-env.outputs.cache-hit != 'true' | ||
|
||
- name: Install dependencies | ||
run: mamba install boa rattler-build anaconda-client | ||
if: steps.cache-env.outputs.cache-hit != 'true' | ||
|
||
- name: Update conda & dependencies | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
activate-environment: openfisca | ||
environment-file: .env.yaml | ||
miniforge-version: latest | ||
use-mamba: true | ||
if: steps.cache-env.outputs.cache-hit == 'true' | ||
|
||
- name: Build pylint plugin package | ||
run: | | ||
rattler-build build \ | ||
--recipe .conda/pylint-per-file-ignores \ | ||
--output-dir ~/conda-rel | ||
- name: Build core package | ||
run: | | ||
conda mambabuild .conda/openfisca-core \ | ||
--use-local \ | ||
--no-anaconda-upload \ | ||
--output-folder ~/conda-rel \ | ||
--numpy ${{ inputs.numpy }} \ | ||
--python ${{ inputs.python }} | ||
- name: Build country template package | ||
run: | | ||
rattler-build build \ | ||
--recipe .conda/openfisca-country-template \ | ||
--output-dir ~/conda-rel \ | ||
- name: Build extension template package | ||
run: | | ||
rattler-build build \ | ||
--recipe .conda/openfisca-extension-template \ | ||
--output-dir ~/conda-rel | ||
- name: Export env | ||
run: mamba env export --name openfisca > .env.yaml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: Setup package | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
os: | ||
required: true | ||
type: string | ||
|
||
numpy: | ||
required: true | ||
type: string | ||
|
||
python: | ||
required: true | ||
type: string | ||
|
||
activate_command: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
deps: | ||
runs-on: ${{ inputs.os }} | ||
name: pip-deps-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }} | ||
env: | ||
# To colorize output of make tasks. | ||
TERM: xterm-256color | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python }} | ||
|
||
- name: Use zstd for faster cache restore (windows) | ||
if: ${{ startsWith(inputs.os, 'windows') }} | ||
shell: cmd | ||
run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%" | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: venv | ||
key: pip-deps-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-${{ hashFiles('setup.py') }} | ||
restore-keys: pip-deps-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}- | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m venv venv | ||
${{ inputs.activate_command }} | ||
make install-deps install-dist | ||
pip install numpy==${{ inputs.numpy }} | ||
build: | ||
runs-on: ${{ inputs.os }} | ||
needs: [deps] | ||
name: pip-build-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }} | ||
env: | ||
TERM: xterm-256color | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python }} | ||
|
||
- name: Use zstd for faster cache restore (windows) | ||
if: ${{ startsWith(inputs.os, 'windows') }} | ||
shell: cmd | ||
run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%" | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: venv | ||
key: pip-deps-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-${{ hashFiles('setup.py') }} | ||
|
||
- name: Cache build | ||
uses: actions/cache@v4 | ||
with: | ||
path: venv/**/[Oo]pen[Ff]isca* | ||
key: pip-build-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-${{ hashFiles('setup.py') }}-${{ github.sha }} | ||
restore-keys: | | ||
pip-build-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-${{ hashFiles('setup.py') }}- | ||
pip-build-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}- | ||
- name: Cache release | ||
uses: actions/cache@v4 | ||
with: | ||
path: dist | ||
key: pip-release-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-${{ hashFiles('setup.py') }}-${{ github.sha }} | ||
|
||
- name: Build package | ||
run: | | ||
${{ inputs.activate_command }} | ||
make install-test clean build |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Lint package | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
os: | ||
required: true | ||
type: string | ||
|
||
numpy: | ||
required: true | ||
type: string | ||
|
||
python: | ||
required: true | ||
type: string | ||
|
||
activate_command: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
lint: | ||
runs-on: ${{ inputs.os }} | ||
name: pip-lint-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }} | ||
env: | ||
TERM: xterm-256color # To colorize output of make tasks. | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python }} | ||
|
||
- name: Use zstd for faster cache restore (windows) | ||
if: ${{ startsWith(inputs.os, 'windows') }} | ||
shell: cmd | ||
run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%" | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: venv | ||
key: pip-deps-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-${{ hashFiles('setup.py') }} | ||
|
||
- name: Lint doc | ||
run: | | ||
${{ inputs.activate_command }} | ||
make clean check-syntax-errors lint-doc | ||
- name: Lint styles | ||
run: | | ||
${{ inputs.activate_command }} | ||
make clean check-syntax-errors check-style |
Oops, something went wrong.