Skip to content

Commit

Permalink
Corrige la gestion des caches dans l'intégration continue
Browse files Browse the repository at this point in the history
Merge pull request #1685 from openfisca/build-cache
  • Loading branch information
HAEKADI authored Oct 18, 2021
2 parents bdda177 + ff79721 commit ff9d9e2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} # Cache the entire build Python environment
key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}
restore-keys: | # in case of a cache miss (systematically unless the same commit is built repeatedly), the keys below will be used to restore dependencies from previous builds, and the cache will be stored at the end of the job, making up-to-date dependencies available for all jobs of the workflow; see more at https://docs.github.com/en/actions/advanced-guides/caching-dependencies-to-speed-up-workflows#example-using-the-cache-action
build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}
build-${{ env.pythonLocation }}-
- name: Build package
if: steps.restore-build.outputs.cache-hit != 'true'
run: make build
- name: Cache build release
id: restore-build-release
- name: Cache release
id: restore-release
uses: actions/cache@v2
with:
path: dist
key: ${{ github.ref }}${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }}
key: release-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}

lint-files:
runs-on: ubuntu-latest
Expand All @@ -44,7 +46,7 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}
key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}
- run: make check-syntax-errors
- run: make check-style
- name: Lint Python files
Expand All @@ -66,7 +68,7 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}
key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}
- run: |
shopt -s globstar
openfisca test tests/**/*.py
Expand All @@ -93,7 +95,7 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}
key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}
- name: Split YAML tests
id: yaml-test
env:
Expand All @@ -119,7 +121,7 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}
key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}
- name: Test the Web API
run: "${GITHUB_WORKSPACE}/.github/test-api.sh"

Expand Down Expand Up @@ -155,12 +157,11 @@ jobs:
with:
python-version: 3.7.12
- id: stop-early
run: if "${GITHUB_WORKSPACE}/.github/has-functional-changes.sh" ; then echo "::set-output name=status::success" ; fi
run: "${GITHUB_WORKSPACE}/.github/has-functional-changes.sh"

deploy:
runs-on: ubuntu-latest
needs: [ check-for-functional-changes ]
if: needs.check-for-functional-changes.outputs.status == 'success'
env:
PYPI_USERNAME: openfisca-bot
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
Expand All @@ -177,13 +178,13 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}
- name: Cache build release
id: restore-build-release
key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}
- name: Cache release
id: restore-release
uses: actions/cache@v2
with:
path: dist
key: ${{ github.ref }}${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }}
key: release-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}
- name: Upload a Python package to PyPi
run: twine upload dist/* --username $PYPI_USERNAME --password $PYPI_PASSWORD
- name: Publish a git tag
Expand Down Expand Up @@ -214,7 +215,7 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}
key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}
- name: Check api version
id: check-api-version
run: python ${GITHUB_WORKSPACE}/.github/check-api-version.py
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

### 79.0.4 [#1685](https://github.com/openfisca/openfisca-france/pull/1685)

* Amélioration technique.
* Zones impactées : configuration de l'intégration continue.
* Détails :
- Corrige la gestion des caches dans l'intégration continue

### 79.0.3 [#1689](https://github.com/openfisca/openfisca-france/pull/1689)

* Évolution du système socio-fiscal.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name = "OpenFisca-France",
version = "79.0.3",
version = "79.0.4",
author = "OpenFisca Team",
author_email = "contact@openfisca.fr",
classifiers = [
Expand Down

0 comments on commit ff9d9e2

Please sign in to comment.