Skip to content

Commit

Permalink
ci: pre-render recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
bonjourmauko committed Oct 3, 2024
1 parent fc4dbbe commit 10a855f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/_before-conda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,25 @@ jobs:
.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-env
id: cache-deps

- name: Cache meta
uses: actions/cache@v4
with:
path: |
.conda/openfisca-core/meta.yaml
.conda/openfisca-core/recipe.yaml
key: conda-meta-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-${{ hashFiles('setup.py') }}
restore-keys: conda-meta-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-
id: cache-meta

- name: Cache release
uses: actions/cache@v4
Expand All @@ -66,7 +77,7 @@ jobs:

- name: Install dependencies
run: |
micromamba install boa rattler-build anaconda-client
micromamba install boa rattler-build anaconda-client conda-recipe-manager
micromamba install numpy=${{ inputs.numpy }}
micromamba install python=${{ inputs.python }}
if: steps.cache-env.outputs.cache-hit != 'true'
Expand All @@ -86,13 +97,20 @@ jobs:
--recipe .conda/pylint-per-file-ignores \
--output-dir ~/conda-rel
- name: Build core package
- name: Render core recipe
run: |
conda render .conda/openfisca-core \
--channel file:///home/runner/conda-rel \
--numpy ${{ inputs.numpy }} \
--python ${{ inputs.python }}
echo .conda/openfisca-core/meta.yaml
if: steps.cache-meta.outputs.cache-hit != 'true'

- name: Build core package
run: |
cat .conda/openfisca-core/meta.yaml
conda-recipe-manager convert .conda/openfisca-core/meta.yaml > .conda/openfisca-core/recipe.yaml
cat .conda/openfisca-core/recipe.yaml
conda mambabuild .conda/openfisca-core \
--use-local \
--no-anaconda-upload \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_test-conda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:

- name: Install packages
run: |
mamba install --channel file:///home/runner/conda-rel \
micromamba install --channel file:///home/runner/conda-rel \
openfisca-core-dev \
openfisca-country-template \
openfisca-extension-template
Expand Down

0 comments on commit 10a855f

Please sign in to comment.