From 70440fe192d2cfc02d6cca12777765554bef4535 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 29 Sep 2021 10:07:17 +0200 Subject: [PATCH 01/95] Add GitHub Actions config --- .github/get-numpy-version.py | 38 ++++ .github/has-functional-changes.sh | 12 ++ .github/is-version-number-acceptable.sh | 33 ++++ .github/lint-changed-python-files.sh | 11 ++ .github/lint-changed-yaml-tests.sh | 11 ++ .github/publish-git-tag.sh | 4 + .github/publish-python-package.sh | 4 + .github/workflows/workflow.yml | 225 ++++++++++++++++++++++++ 8 files changed, 338 insertions(+) create mode 100755 .github/get-numpy-version.py create mode 100755 .github/has-functional-changes.sh create mode 100755 .github/is-version-number-acceptable.sh create mode 100755 .github/lint-changed-python-files.sh create mode 100755 .github/lint-changed-yaml-tests.sh create mode 100755 .github/publish-git-tag.sh create mode 100755 .github/publish-python-package.sh create mode 100644 .github/workflows/workflow.yml diff --git a/.github/get-numpy-version.py b/.github/get-numpy-version.py new file mode 100755 index 0000000000..64cb68532e --- /dev/null +++ b/.github/get-numpy-version.py @@ -0,0 +1,38 @@ +#! /usr/bin/env python + +from __future__ import annotations + +import os +import sys +import typing +from packaging import version +from typing import NoReturn, Union + +import numpy + +if typing.TYPE_CHECKING: + from packaging.version import LegacyVersion, Version + + +def prev() -> NoReturn: + release = _installed().release + + if release is None: + sys.exit(os.EX_DATAERR) + + major, minor, _ = release + + if minor == 0: + sys.exit(os.EX_DATAERR) + + minor -= 1 + print(f"{major}.{minor}.0") # noqa: T001 + sys.exit(os.EX_OK) + + +def _installed() -> Union[LegacyVersion, Version]: + return version.parse(numpy.__version__) + + +if __name__ == "__main__": + globals()[sys.argv[1]]() diff --git a/.github/has-functional-changes.sh b/.github/has-functional-changes.sh new file mode 100755 index 0000000000..15706e8a1b --- /dev/null +++ b/.github/has-functional-changes.sh @@ -0,0 +1,12 @@ +#! /usr/bin/env bash + +IGNORE_DIFF_ON="README.md CONTRIBUTING.md Makefile .gitignore LICENSE* .github/* tests/*" + +last_tagged_commit=`git describe --tags --abbrev=0 --first-parent` # --first-parent ensures we don't follow tags not published in master through an unlikely intermediary merge commit + +if git diff-index --name-only --exit-code $last_tagged_commit -- . `echo " $IGNORE_DIFF_ON" | sed 's/ / :(exclude)/g'` # Check if any file that has not be listed in IGNORE_DIFF_ON has changed since the last tag was published. +then + echo "No functional changes detected." + exit 1 +else echo "The functional files above were changed." +fi diff --git a/.github/is-version-number-acceptable.sh b/.github/is-version-number-acceptable.sh new file mode 100755 index 0000000000..f4fb2c1bcf --- /dev/null +++ b/.github/is-version-number-acceptable.sh @@ -0,0 +1,33 @@ +#! /usr/bin/env bash + +if [[ ${GITHUB_REF#refs/heads/} == master ]] +then + echo "No need for a version check on master." + exit 0 +fi + +if ! $(dirname "$BASH_SOURCE")/has-functional-changes.sh +then + echo "No need for a version update." + exit 0 +fi + +current_version=`python setup.py --version` + +if git rev-parse --verify --quiet $current_version +then + echo "Version $current_version already exists in commit:" + git --no-pager log -1 $current_version + echo + echo "Update the version number in setup.py before merging this branch into master." + echo "Look at the CONTRIBUTING.md file to learn how the version number should be updated." + exit 1 +fi + +if ! $(dirname "$BASH_SOURCE")/has-functional-changes.sh | grep --quiet CHANGELOG.md +then + echo "CHANGELOG.md has not been modified, while functional changes were made." + echo "Explain what you changed before merging this branch into master." + echo "Look at the CONTRIBUTING.md file to learn how to write the changelog." + exit 2 +fi diff --git a/.github/lint-changed-python-files.sh b/.github/lint-changed-python-files.sh new file mode 100755 index 0000000000..72d8aad639 --- /dev/null +++ b/.github/lint-changed-python-files.sh @@ -0,0 +1,11 @@ +#! /usr/bin/env bash + +last_tagged_commit=`git describe --tags --abbrev=0 --first-parent` # --first-parent ensures we don't follow tags not published in master through an unlikely intermediary merge commit + +if ! changes=$(git diff-index --name-only --diff-filter=ACMR --exit-code $last_tagged_commit -- "*.py") +then + echo "Linting the following Python files:" + echo $changes + flake8 $changes +else echo "No changed Python files to lint" +fi diff --git a/.github/lint-changed-yaml-tests.sh b/.github/lint-changed-yaml-tests.sh new file mode 100755 index 0000000000..16e99432b6 --- /dev/null +++ b/.github/lint-changed-yaml-tests.sh @@ -0,0 +1,11 @@ +#! /usr/bin/env bash + +last_tagged_commit=`git describe --tags --abbrev=0 --first-parent` # --first-parent ensures we don't follow tags not published in master through an unlikely intermediary merge commit + +if ! changes=$(git diff-index --name-only --diff-filter=ACMR --exit-code $last_tagged_commit -- "tests/*.yaml") +then + echo "Linting the following changed YAML tests:" + echo $changes + yamllint $changes +else echo "No changed YAML tests to lint" +fi diff --git a/.github/publish-git-tag.sh b/.github/publish-git-tag.sh new file mode 100755 index 0000000000..4450357cbc --- /dev/null +++ b/.github/publish-git-tag.sh @@ -0,0 +1,4 @@ +#! /usr/bin/env bash + +git tag `python setup.py --version` +git push --tags # update the repository version diff --git a/.github/publish-python-package.sh b/.github/publish-python-package.sh new file mode 100755 index 0000000000..8d331bd946 --- /dev/null +++ b/.github/publish-python-package.sh @@ -0,0 +1,4 @@ +#! /usr/bin/env bash + +python setup.py bdist_wheel # build this package in the dist directory +twine upload dist/* --username $PYPI_USERNAME --password $PYPI_PASSWORD # publish diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000000..53a467210e --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,225 @@ +name: OpenFisca Core + +on: [ push ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Cache build + id: restore-build + uses: actions/cache@v2 + with: + path: ${{ env.pythonLocation }} + key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} # Cache the entire build Python environment + - name: Build + if: steps.restore-install.outputs.cache-hit != 'true' + run: make build + - name: Cache build release + id: restore-build-release + uses: actions/cache@v2 + with: + path: dist + key: ${{ github.ref }}${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }} + + test-python: + runs-on: ubuntu-latest + needs: [ build ] + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Cache build + id: restore-build + uses: actions/cache@v2 + with: + path: ${{ env.pythonLocation }} + key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} + - name: Run Core tests + run: env PYTEST_ADDOPTS="--exitfirst" make test + + check-numpy: + runs-on: ubuntu-latest + needs: [ build ] + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Cache build + id: restore-build + uses: actions/cache@v2 + with: + path: ${{ env.pythonLocation }} + key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} + - name: Check NumPy typing against latest 3 minor versions + run: for i in {1..3}; do VERSION=$(${GITHUB_WORKSPACE}/.github/get-numpy-version.py prev) && pip install numpy==$VERSION && make check-types; done + + test-country-template: + runs-on: ubuntu-latest + needs: [ build ] + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Cache build + id: restore-build + uses: actions/cache@v2 + with: + path: ${{ env.pythonLocation }} + key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} + - name: Run Country Template tests + run: | + COUNTRY_TEMPLATE_PATH=`python -c "import openfisca_country_template; print(openfisca_country_template.CountryTaxBenefitSystem().get_package_metadata()['location'])"` + openfisca test $COUNTRY_TEMPLATE_PATH/openfisca_country_template/tests/ + + test-docs: + runs-on: ubuntu-latest + needs: [ build ] + steps: + - uses: actions/checkout@v2 + - name: Checkout docs + run: make test-doc-checkout branch=${GITHUB_REF#refs/heads/} + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Cache build + id: restore-build + uses: actions/cache@v2 + with: + path: ${{ env.pythonLocation }} + key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} + - name: Cache docs + id: restore-docs + uses: actions/cache@v2 + with: + path: ${{ env.pythonLocation }} + key: ${{ github.ref }}${{ env.pythonLocation }}-docs-${{ hashFiles('doc/requirements.txt') }} + - name: Install dependencies + run: make test-doc-install + - name: Run doc tests + run: make test-doc-build + + lint-files: + runs-on: ubuntu-latest + needs: [ build ] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Fetch all the tags + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Cache build + id: restore-build + uses: actions/cache@v2 + with: + path: ${{ env.pythonLocation }} + key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} + - run: make check-syntax-errors + - run: make check-style + - name: Lint Python files + run: "${GITHUB_WORKSPACE}/.github/lint-changed-python-files.sh" + - name: Lint YAML tests + run: "${GITHUB_WORKSPACE}/.github/lint-changed-yaml-tests.sh" + + check-version: + runs-on: ubuntu-latest + needs: [ test-python, check-numpy, test-country-template, test-doc, lint-files ] # Last job to run + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Fetch all the tags + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Check version number has been properly updated + run: "${GITHUB_WORKSPACE}/.github/is-version-number-acceptable.sh" + + sumbit-coverage: + runs-on: ubuntu-latest + needs: [ test-python, check-numpy, test-country-template ] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Fetch all the tags + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Cache build + id: restore-build + uses: actions/cache@v2 + with: + path: ${{ env.pythonLocation }} + key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} + - name: Submit coverage to Coveralls + run: | + pip install coveralls + coveralls + + check-for-functional-changes: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' # Only triggered for the `master` branch + needs: [ check-version ] + outputs: + status: ${{ steps.stop-early.outputs.status }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Fetch all the tags + - name: Set up Python + uses: actions/setup-python@v2 + 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 + + 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 }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Fetch all the tags + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Cache build + id: restore-build + uses: actions/cache@v2 + with: + path: ${{ env.pythonLocation }} + key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} + - name: Cache build release + id: restore-build-release + uses: actions/cache@v2 + with: + path: dist + key: ${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }} + - name: Upload a Python package to PyPi + run: twine upload dist/* --username $PYPI_USERNAME --password $PYPI_PASSWORD + - name: Publish a git tag + run: "${GITHUB_WORKSPACE}/.github/publish-git-tag.sh" + - name: Update doc + run: | + curl -X POST --header "Content-Type: application/json" -d '{"branch":"master"}' https://circleci.com/api/v1.1/project/github/openfisca/openfisca-doc/build?circle-token=$CIRCLE_TOKEN From 811b6219f6e7534609ce7fad71cd84490014d608 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 29 Sep 2021 10:08:49 +0200 Subject: [PATCH 02/95] Correct indent --- .github/workflows/workflow.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 53a467210e..c2bfcb2ca8 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -52,9 +52,9 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 - name: Cache build id: restore-build uses: actions/cache@v2 From dc70f8904ba62f4314c6a1d1e4f0ce8e26bce68f Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 29 Sep 2021 10:09:47 +0200 Subject: [PATCH 03/95] Correct indent --- .github/workflows/workflow.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index c2bfcb2ca8..98f4897b00 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -70,9 +70,9 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 - name: Cache build id: restore-build uses: actions/cache@v2 From 698f1a85b2652e6c6d945cd508b482b61c0943aa Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 29 Sep 2021 10:11:51 +0200 Subject: [PATCH 04/95] Change quotes --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 98f4897b00..af5cc8bdf0 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -222,4 +222,4 @@ jobs: run: "${GITHUB_WORKSPACE}/.github/publish-git-tag.sh" - name: Update doc run: | - curl -X POST --header "Content-Type: application/json" -d '{"branch":"master"}' https://circleci.com/api/v1.1/project/github/openfisca/openfisca-doc/build?circle-token=$CIRCLE_TOKEN + curl -X POST --header 'Content-Type: application/json' -d '{"branch":"master"}' https://circleci.com/api/v1.1/project/github/openfisca/openfisca-doc/build?circle-token=$CIRCLE_TOKEN From e12cf4adf0432508e128b49d0f974abaecb12c1d Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 29 Sep 2021 10:13:16 +0200 Subject: [PATCH 05/95] Correct job name --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index af5cc8bdf0..b66566e984 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -138,7 +138,7 @@ jobs: check-version: runs-on: ubuntu-latest - needs: [ test-python, check-numpy, test-country-template, test-doc, lint-files ] # Last job to run + needs: [ test-python, check-numpy, test-country-template, test-docs, lint-files ] # Last job to run steps: - uses: actions/checkout@v2 with: From 0c64a30b325d1747369cd296cbe25d3e389dcb52 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 29 Sep 2021 10:40:50 +0200 Subject: [PATCH 06/95] Test pytest --- .github/workflows/workflow.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index b66566e984..65447ec28e 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -44,7 +44,8 @@ jobs: path: ${{ env.pythonLocation }} key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} - name: Run Core tests - run: env PYTEST_ADDOPTS="--exitfirst" make test + # run: env PYTEST_ADDOPTS="--exitfirst" make test + run: pytest check-numpy: runs-on: ubuntu-latest From 4334c29adbc5e5d640c268e23df680da546d5151 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 29 Sep 2021 10:53:12 +0200 Subject: [PATCH 07/95] Test make test --- .github/workflows/workflow.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 65447ec28e..b66566e984 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -44,8 +44,7 @@ jobs: path: ${{ env.pythonLocation }} key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} - name: Run Core tests - # run: env PYTEST_ADDOPTS="--exitfirst" make test - run: pytest + run: env PYTEST_ADDOPTS="--exitfirst" make test check-numpy: runs-on: ubuntu-latest From 9c8643181bd48cc71c33a43c9acba9c786e1747e Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 29 Sep 2021 11:20:24 +0200 Subject: [PATCH 08/95] Test make test --- .github/workflows/workflow.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index b66566e984..f6c1025ca7 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -44,7 +44,9 @@ jobs: path: ${{ env.pythonLocation }} key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} - name: Run Core tests - run: env PYTEST_ADDOPTS="--exitfirst" make test + run: | + shopt -s globstar + env PYTEST_ADDOPTS="--exitfirst" make test check-numpy: runs-on: ubuntu-latest From f390aa43d3a2af517f2edd39678e6fde4692d3f3 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 29 Sep 2021 11:29:28 +0200 Subject: [PATCH 09/95] Add test to build job --- .github/workflows/workflow.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index f6c1025ca7..4804b3078c 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -27,6 +27,8 @@ jobs: with: path: dist key: ${{ github.ref }}${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }} + - name: Run tests + run: env PYTEST_ADDOPTS="--exitfirst" make test test-python: runs-on: ubuntu-latest From 7b8f2f817a4367f4810a26c34dedba03dc2d1eb9 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 29 Sep 2021 11:35:00 +0200 Subject: [PATCH 10/95] Test pytest in build --- .github/workflows/workflow.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 4804b3078c..9f654dda73 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -34,7 +34,8 @@ jobs: runs-on: ubuntu-latest needs: [ build ] steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v2 with: @@ -46,9 +47,7 @@ jobs: path: ${{ env.pythonLocation }} key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} - name: Run Core tests - run: | - shopt -s globstar - env PYTEST_ADDOPTS="--exitfirst" make test + run: env PYTEST_ADDOPTS="--exitfirst" make test check-numpy: runs-on: ubuntu-latest From 0c6c8e0ce561360f29a890c1f64e9157763393f0 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 29 Sep 2021 11:38:57 +0200 Subject: [PATCH 11/95] Add dist cache to test-python --- .github/workflows/workflow.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 9f654dda73..0ddeee26bc 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -46,6 +46,12 @@ jobs: with: path: ${{ env.pythonLocation }} key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} + - name: Cache build release + id: restore-build-release + uses: actions/cache@v2 + with: + path: dist + key: ${{ github.ref }}${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }} - name: Run Core tests run: env PYTEST_ADDOPTS="--exitfirst" make test From 080405c6f0cbc7702ffff52c8ecfd840feeac8ff Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 29 Sep 2021 12:09:42 +0200 Subject: [PATCH 12/95] Add cache coverage --- .github/workflows/workflow.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 0ddeee26bc..c4203e58c1 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -27,15 +27,21 @@ jobs: with: path: dist key: ${{ github.ref }}${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }} + - name: Cache coverage + id: restore-coverage + uses: actions/cache@v2 + with: + path: .coverage + key: ${{ github.ref }}${{ env.pythonLocation }}-coverage - name: Run tests run: env PYTEST_ADDOPTS="--exitfirst" make test + test-python: runs-on: ubuntu-latest needs: [ build ] steps: - - name: Checkout - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v2 with: @@ -46,12 +52,12 @@ jobs: with: path: ${{ env.pythonLocation }} key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} - - name: Cache build release - id: restore-build-release + - name: Cache coverage + id: restore-coverage uses: actions/cache@v2 with: - path: dist - key: ${{ github.ref }}${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }} + path: .coverage + key: ${{ github.ref }}${{ env.pythonLocation }}-coverage - name: Run Core tests run: env PYTEST_ADDOPTS="--exitfirst" make test From de9ea78594075c9785524fca29d98d1e3a1e2fdb Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 29 Sep 2021 12:13:15 +0200 Subject: [PATCH 13/95] Test make test alone --- .github/workflows/workflow.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index c4203e58c1..6e19e3a2f7 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -27,12 +27,6 @@ jobs: with: path: dist key: ${{ github.ref }}${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }} - - name: Cache coverage - id: restore-coverage - uses: actions/cache@v2 - with: - path: .coverage - key: ${{ github.ref }}${{ env.pythonLocation }}-coverage - name: Run tests run: env PYTEST_ADDOPTS="--exitfirst" make test @@ -52,14 +46,8 @@ jobs: with: path: ${{ env.pythonLocation }} key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} - - name: Cache coverage - id: restore-coverage - uses: actions/cache@v2 - with: - path: .coverage - key: ${{ github.ref }}${{ env.pythonLocation }}-coverage - name: Run Core tests - run: env PYTEST_ADDOPTS="--exitfirst" make test + run: make test check-numpy: runs-on: ubuntu-latest From 9d83e474d4d893bdf0a2f3eefde3e16d2b160064 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 29 Sep 2021 12:16:04 +0200 Subject: [PATCH 14/95] Add install to test job --- .github/workflows/workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 6e19e3a2f7..31b924aebb 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -46,6 +46,7 @@ jobs: with: path: ${{ env.pythonLocation }} key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} + - run: make install - name: Run Core tests run: make test From 935da567a4d4d75bde7596ac62450ba073772bed Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 29 Sep 2021 13:05:41 +0200 Subject: [PATCH 15/95] Add github token --- .github/workflows/workflow.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 31b924aebb..bc83b1e416 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -34,6 +34,8 @@ jobs: test-python: runs-on: ubuntu-latest needs: [ build ] + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 - name: Set up Python @@ -46,7 +48,6 @@ jobs: with: path: ${{ env.pythonLocation }} key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} - - run: make install - name: Run Core tests run: make test @@ -157,6 +158,8 @@ jobs: sumbit-coverage: runs-on: ubuntu-latest needs: [ test-python, check-numpy, test-country-template ] + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 with: From f0f0fe213a57b5c6f4a197dfa6892885eb6fa37a Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 29 Sep 2021 13:07:14 +0200 Subject: [PATCH 16/95] Remove tests from build --- .github/workflows/workflow.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index bc83b1e416..61526433bb 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -27,9 +27,6 @@ jobs: with: path: dist key: ${{ github.ref }}${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }} - - name: Run tests - run: env PYTEST_ADDOPTS="--exitfirst" make test - test-python: runs-on: ubuntu-latest From 01ed806bc189571cf66e3835de70d7bac6cb329e Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 29 Sep 2021 13:09:27 +0200 Subject: [PATCH 17/95] Add build to test job --- .github/workflows/workflow.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 61526433bb..084fb9accd 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -18,7 +18,7 @@ jobs: with: path: ${{ env.pythonLocation }} key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} # Cache the entire build Python environment - - name: Build + - name: Build package if: steps.restore-install.outputs.cache-hit != 'true' run: make build - name: Cache build release @@ -45,6 +45,8 @@ jobs: with: path: ${{ env.pythonLocation }} key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} + - name: Build package + run: make build - name: Run Core tests run: make test From 6ff431c21131c0a9050b9882d7cd74a2e97675cc Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 10:25:56 +0200 Subject: [PATCH 18/95] Add restore keys to build cache --- .github/workflows/workflow.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 084fb9accd..4bd58af450 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -17,7 +17,11 @@ 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: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} # Cache the entire build Python environment + restore-keys: | + ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }} + ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} + ${{ env.pythonLocation }}-build- - name: Build package if: steps.restore-install.outputs.cache-hit != 'true' run: make build @@ -26,7 +30,7 @@ jobs: uses: actions/cache@v2 with: path: dist - key: ${{ github.ref }}${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }} + key: ${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} test-python: runs-on: ubuntu-latest @@ -44,7 +48,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} + key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} - name: Build package run: make build - name: Run Core tests @@ -64,7 +68,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} + key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} - name: Check NumPy typing against latest 3 minor versions run: for i in {1..3}; do VERSION=$(${GITHUB_WORKSPACE}/.github/get-numpy-version.py prev) && pip install numpy==$VERSION && make check-types; done @@ -82,7 +86,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} + key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} - name: Run Country Template tests run: | COUNTRY_TEMPLATE_PATH=`python -c "import openfisca_country_template; print(openfisca_country_template.CountryTaxBenefitSystem().get_package_metadata()['location'])"` @@ -104,7 +108,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} + key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} - name: Cache docs id: restore-docs uses: actions/cache@v2 @@ -132,7 +136,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} + key: $${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} - run: make check-syntax-errors - run: make check-style - name: Lint Python files @@ -172,7 +176,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ github.ref }}${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} + key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} - name: Submit coverage to Coveralls run: | pip install coveralls @@ -215,13 +219,13 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} + key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} - name: Cache build release id: restore-build-release uses: actions/cache@v2 with: path: dist - key: ${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }} + key: ${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} - name: Upload a Python package to PyPi run: twine upload dist/* --username $PYPI_USERNAME --password $PYPI_PASSWORD - name: Publish a git tag From 7f3740809fc4cf4d507b7297cd9b2cd52d910fc1 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 10:27:33 +0200 Subject: [PATCH 19/95] Remove cache hit condition --- .github/workflows/workflow.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 4bd58af450..cf1ee25d8c 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -23,7 +23,6 @@ jobs: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} ${{ env.pythonLocation }}-build- - name: Build package - if: steps.restore-install.outputs.cache-hit != 'true' run: make build - name: Cache build release id: restore-build-release From c1f4f43b2fff848ece14ea22e1528ead3ff82af9 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 10:35:31 +0200 Subject: [PATCH 20/95] Remove build from test --- .github/workflows/workflow.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index cf1ee25d8c..0dc1940da3 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -48,8 +48,6 @@ jobs: with: path: ${{ env.pythonLocation }} key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} - - name: Build package - run: make build - name: Run Core tests run: make test From bfa5f734cc51f2c6d5ecab2bc3897de18c790e43 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 10:38:27 +0200 Subject: [PATCH 21/95] Remove restore keys --- .github/workflows/workflow.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 0dc1940da3..41bda55e0b 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -18,10 +18,6 @@ jobs: with: path: ${{ env.pythonLocation }} key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} # Cache the entire build Python environment - restore-keys: | - ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }} - ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} - ${{ env.pythonLocation }}-build- - name: Build package run: make build - name: Cache build release From daaa366a26ae62b66bf896d89114cf68b5fa0879 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 10:43:09 +0200 Subject: [PATCH 22/95] Add restore keys and correct typo --- .github/workflows/workflow.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 41bda55e0b..4afd3a88e1 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -18,6 +18,10 @@ jobs: with: path: ${{ env.pythonLocation }} key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} # Cache the entire build Python environment + restore-keys: | + ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }} + ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} + ${{ env.pythonLocation }}-build- - name: Build package run: make build - name: Cache build release @@ -129,7 +133,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: $${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} + key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} - run: make check-syntax-errors - run: make check-style - name: Lint Python files From 114f5213356d3fc28f001f7a43d58c8fe0aeeb25 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 10:55:32 +0200 Subject: [PATCH 23/95] Remove step output from check-for-functional-changes --- .github/workflows/workflow.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 4afd3a88e1..700db8a802 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -194,12 +194,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 }} From e090bd472bfc847b07b92e141d3b68b7e48ce2a6 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 10:59:03 +0200 Subject: [PATCH 24/95] Test pytest --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 700db8a802..e5db2b5d2e 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -49,7 +49,7 @@ jobs: path: ${{ env.pythonLocation }} key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} - name: Run Core tests - run: make test + run: pytest check-numpy: runs-on: ubuntu-latest From 46efb5dc6e8d4e19ba77b5ba01ac1d2c8a99a702 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 11:08:13 +0200 Subject: [PATCH 25/95] Add Python version patch --- .github/workflows/workflow.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index e5db2b5d2e..0deca47792 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -11,7 +11,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.7.12 - name: Cache build id: restore-build uses: actions/cache@v2 @@ -41,7 +41,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.7.12 - name: Cache build id: restore-build uses: actions/cache@v2 @@ -59,7 +59,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.7.12 - name: Cache build id: restore-build uses: actions/cache@v2 @@ -77,7 +77,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.7.12 - name: Cache build id: restore-build uses: actions/cache@v2 @@ -99,7 +99,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.7.12 - name: Cache build id: restore-build uses: actions/cache@v2 @@ -127,7 +127,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.7.12 - name: Cache build id: restore-build uses: actions/cache@v2 @@ -151,7 +151,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.7.12 - name: Check version number has been properly updated run: "${GITHUB_WORKSPACE}/.github/is-version-number-acceptable.sh" @@ -167,7 +167,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.7.12 - name: Cache build id: restore-build uses: actions/cache@v2 @@ -209,7 +209,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.7.12 - name: Cache build id: restore-build uses: actions/cache@v2 From bd1700f296ae2262b78af4ff63e964ff361fbde0 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 11:28:45 +0200 Subject: [PATCH 26/95] Add env cache --- .github/workflows/workflow.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 0deca47792..4277fc54fd 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -22,6 +22,12 @@ jobs: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }} ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} ${{ env.pythonLocation }}-build- + - name: Cache env + id: restore-env + uses: actions/cache@v2 + with: + path: ${{ env }} + key: ${{ env }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} - name: Build package run: make build - name: Cache build release @@ -34,8 +40,6 @@ jobs: test-python: runs-on: ubuntu-latest needs: [ build ] - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 - name: Set up Python @@ -48,6 +52,12 @@ jobs: with: path: ${{ env.pythonLocation }} key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} + - name: Cache env + id: restore-env + uses: actions/cache@v2 + with: + path: ${{ env }} + key: ${{ env }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} - name: Run Core tests run: pytest From 1dd12404af16653c1008045becbc6f984425e5d7 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 11:31:57 +0200 Subject: [PATCH 27/95] Cache entire home dir --- .github/workflows/workflow.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 4277fc54fd..06f60fc475 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -26,8 +26,8 @@ jobs: id: restore-env uses: actions/cache@v2 with: - path: ${{ env }} - key: ${{ env }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} + path: . + key: build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} - name: Build package run: make build - name: Cache build release @@ -50,8 +50,8 @@ jobs: id: restore-build uses: actions/cache@v2 with: - path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} + path: . + key: build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} - name: Cache env id: restore-env uses: actions/cache@v2 From 9164ab75a94d64dd09bfde24829c2a232f3d0228 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 11:35:21 +0200 Subject: [PATCH 28/95] Cache entire home dir --- .github/workflows/workflow.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 06f60fc475..38f1e5e2a4 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -50,14 +50,14 @@ jobs: id: restore-build uses: actions/cache@v2 with: - path: . - key: build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} + path: ${{ env.pythonLocation }} + key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} - name: Cache env id: restore-env uses: actions/cache@v2 with: - path: ${{ env }} - key: ${{ env }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} + path: . + key: build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} - name: Run Core tests run: pytest From 0b68e0f17522e39b4a8abb6576aa965a95b9754c Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 11:48:14 +0200 Subject: [PATCH 29/95] Add build to Python test job --- .github/workflows/workflow.yml | 36 ++++++++++++---------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 38f1e5e2a4..7a14dcecee 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -11,7 +11,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7.12 + python-version: 3.7 - name: Cache build id: restore-build uses: actions/cache@v2 @@ -22,12 +22,6 @@ jobs: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }} ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} ${{ env.pythonLocation }}-build- - - name: Cache env - id: restore-env - uses: actions/cache@v2 - with: - path: . - key: build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} - name: Build package run: make build - name: Cache build release @@ -45,21 +39,17 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7.12 + python-version: 3.7 - name: Cache build id: restore-build uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} - - name: Cache env - id: restore-env - uses: actions/cache@v2 - with: - path: . - key: build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} + - name: Build package + run: make build - name: Run Core tests - run: pytest + run: env PYTEST_ADDOPTS="--exitfirst" make test check-numpy: runs-on: ubuntu-latest @@ -69,7 +59,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7.12 + python-version: 3.7 - name: Cache build id: restore-build uses: actions/cache@v2 @@ -87,7 +77,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7.12 + python-version: 3.7 - name: Cache build id: restore-build uses: actions/cache@v2 @@ -109,7 +99,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7.12 + python-version: 3.7 - name: Cache build id: restore-build uses: actions/cache@v2 @@ -137,7 +127,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7.12 + python-version: 3.7 - name: Cache build id: restore-build uses: actions/cache@v2 @@ -161,7 +151,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7.12 + python-version: 3.7 - name: Check version number has been properly updated run: "${GITHUB_WORKSPACE}/.github/is-version-number-acceptable.sh" @@ -177,7 +167,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7.12 + python-version: 3.7 - name: Cache build id: restore-build uses: actions/cache@v2 @@ -202,7 +192,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7.12 + python-version: 3.7 - id: stop-early run: "${GITHUB_WORKSPACE}/.github/has-functional-changes.sh" @@ -219,7 +209,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7.12 + python-version: 3.7 - name: Cache build id: restore-build uses: actions/cache@v2 From 1c5ebc77d8c9cce288dd9cf83dc58cffc953c252 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 12:06:25 +0200 Subject: [PATCH 30/95] Add coverage cache --- .github/workflows/workflow.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 7a14dcecee..502fd6bf0b 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -30,6 +30,12 @@ jobs: with: path: dist key: ${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} + - name: Cache coverage + id: restore-coverage + uses: actions/cache@v2 + with: + path: .coverage + key: ${{ hashFiles('.coverage) }}-${{ github.sha }} test-python: runs-on: ubuntu-latest @@ -174,6 +180,12 @@ jobs: with: path: ${{ env.pythonLocation }} key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} + - name: Cache coverage + id: restore-coverage + uses: actions/cache@v2 + with: + path: .coverage + key: ${{ hashFiles('.coverage) }}-${{ github.sha }} - name: Submit coverage to Coveralls run: | pip install coveralls From d0df3103822cb30b9cda2755f6e2a19d5ffc8a78 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 12:07:21 +0200 Subject: [PATCH 31/95] Remove branch ref from build cache key --- .github/workflows/workflow.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 502fd6bf0b..d9cccc7718 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -17,9 +17,8 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} # Cache the entire build Python environment + key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} # Cache the entire build Python environment restore-keys: | - ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }} ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} ${{ env.pythonLocation }}-build- - name: Build package @@ -29,7 +28,7 @@ jobs: uses: actions/cache@v2 with: path: dist - key: ${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} + key: ${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }}-${{ github.sha }} - name: Cache coverage id: restore-coverage uses: actions/cache@v2 @@ -51,7 +50,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} + key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} - name: Build package run: make build - name: Run Core tests @@ -71,7 +70,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} + key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} - name: Check NumPy typing against latest 3 minor versions run: for i in {1..3}; do VERSION=$(${GITHUB_WORKSPACE}/.github/get-numpy-version.py prev) && pip install numpy==$VERSION && make check-types; done @@ -89,7 +88,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} + key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} - name: Run Country Template tests run: | COUNTRY_TEMPLATE_PATH=`python -c "import openfisca_country_template; print(openfisca_country_template.CountryTaxBenefitSystem().get_package_metadata()['location'])"` @@ -111,7 +110,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} + key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} - name: Cache docs id: restore-docs uses: actions/cache@v2 @@ -139,7 +138,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} + key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} - run: make check-syntax-errors - run: make check-style - name: Lint Python files @@ -179,7 +178,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} + key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} - name: Cache coverage id: restore-coverage uses: actions/cache@v2 @@ -227,13 +226,13 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} + key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} - name: Cache build release id: restore-build-release uses: actions/cache@v2 with: path: dist - key: ${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }}-${{ github.ref }}-${{ github.sha }} + key: ${{ env.pythonLocation }}-build-release-${{ 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 From e5b0819c786069a8efc8f191161b8a2a0c5f9571 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 12:10:47 +0200 Subject: [PATCH 32/95] Add missing quotes --- .github/workflows/workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index d9cccc7718..7f2dcc4162 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -34,7 +34,7 @@ jobs: uses: actions/cache@v2 with: path: .coverage - key: ${{ hashFiles('.coverage) }}-${{ github.sha }} + key: ${{ hashFiles('.coverage') }}-${{ github.sha }} test-python: runs-on: ubuntu-latest @@ -184,7 +184,7 @@ jobs: uses: actions/cache@v2 with: path: .coverage - key: ${{ hashFiles('.coverage) }}-${{ github.sha }} + key: ${{ hashFiles('.coverage') }}-${{ github.sha }} - name: Submit coverage to Coveralls run: | pip install coveralls From b8280e16f9c9e304196bff549b0dcea7d7e7b504 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 12:18:34 +0200 Subject: [PATCH 33/95] Add coverage artifact --- .github/workflows/workflow.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 7f2dcc4162..6b615dbe00 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -29,12 +29,11 @@ jobs: with: path: dist key: ${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }}-${{ github.sha }} - - name: Cache coverage - id: restore-coverage - uses: actions/cache@v2 + - name: Upload coverage after build + uses: actions/upload-artifact@v2 with: + name: coverage path: .coverage - key: ${{ hashFiles('.coverage') }}-${{ github.sha }} test-python: runs-on: ubuntu-latest @@ -179,12 +178,10 @@ jobs: with: path: ${{ env.pythonLocation }} key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} - - name: Cache coverage - id: restore-coverage - uses: actions/cache@v2 + - name: Download coverage from build + uses: actions/download-artifact@v2 with: - path: .coverage - key: ${{ hashFiles('.coverage') }}-${{ github.sha }} + name: coverage - name: Submit coverage to Coveralls run: | pip install coveralls From e3567a6d7a35ca995551139b3ed4b1f40d7b1b03 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 12:25:49 +0200 Subject: [PATCH 34/95] List all dir --- .github/workflows/workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 6b615dbe00..e1c6bf69c7 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -29,6 +29,7 @@ jobs: with: path: dist key: ${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }}-${{ github.sha }} + - run: ls -l - name: Upload coverage after build uses: actions/upload-artifact@v2 with: From 577cadb121db9e384194418c927dba9d544903b5 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 12:30:49 +0200 Subject: [PATCH 35/95] List all dir --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index e1c6bf69c7..03e73edc71 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -29,7 +29,7 @@ jobs: with: path: dist key: ${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }}-${{ github.sha }} - - run: ls -l + - run: ls -al - name: Upload coverage after build uses: actions/upload-artifact@v2 with: From f3ca36de6141a39085c3d24b76ff5874434b94af Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 12:48:48 +0200 Subject: [PATCH 36/95] Add Coveralls GitHub Actions support --- .github/workflows/workflow.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 03e73edc71..7077f9cd05 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -29,12 +29,6 @@ jobs: with: path: dist key: ${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }}-${{ github.sha }} - - run: ls -al - - name: Upload coverage after build - uses: actions/upload-artifact@v2 - with: - name: coverage - path: .coverage test-python: runs-on: ubuntu-latest @@ -179,14 +173,9 @@ jobs: with: path: ${{ env.pythonLocation }} key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} - - name: Download coverage from build - uses: actions/download-artifact@v2 - with: - name: coverage - name: Submit coverage to Coveralls run: | - pip install coveralls - coveralls + coveralls --service=github check-for-functional-changes: runs-on: ubuntu-latest From 2a2f699b4aae51b5e6257452237cfbc03a331233 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 12:52:22 +0200 Subject: [PATCH 37/95] Install coveralls --- .github/workflows/workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 7077f9cd05..2f9e3d04bb 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -175,6 +175,7 @@ jobs: key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} - name: Submit coverage to Coveralls run: | + pip install coveralls coveralls --service=github check-for-functional-changes: From 1931d3d419886fd40da6e3e976c24e738c8931b3 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 13:28:20 +0200 Subject: [PATCH 38/95] Change job order --- .github/workflows/workflow.yml | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 2f9e3d04bb..02417ad7b5 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -140,23 +140,9 @@ jobs: - name: Lint YAML tests run: "${GITHUB_WORKSPACE}/.github/lint-changed-yaml-tests.sh" - check-version: - runs-on: ubuntu-latest - needs: [ test-python, check-numpy, test-country-template, test-docs, lint-files ] # Last job to run - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Fetch all the tags - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - name: Check version number has been properly updated - run: "${GITHUB_WORKSPACE}/.github/is-version-number-acceptable.sh" - sumbit-coverage: runs-on: ubuntu-latest - needs: [ test-python, check-numpy, test-country-template ] + needs: [ test-python, check-numpy, test-country-template, lint-files ] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: @@ -177,6 +163,19 @@ jobs: run: | pip install coveralls coveralls --service=github + check-version: + runs-on: ubuntu-latest + needs: [ test-python, check-numpy, test-country-template, test-docs, lint-files ] # Last job to run + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Fetch all the tags + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Check version number has been properly updated + run: "${GITHUB_WORKSPACE}/.github/is-version-number-acceptable.sh" check-for-functional-changes: runs-on: ubuntu-latest From 6baf1c06b182c9b6361d6e6255800f851badbb60 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 13:29:07 +0200 Subject: [PATCH 39/95] Add build to submit coverage --- .github/workflows/workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 02417ad7b5..6fe1e4b6dc 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -159,6 +159,7 @@ jobs: with: path: ${{ env.pythonLocation }} key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} + - run: make build - name: Submit coverage to Coveralls run: | pip install coveralls From 2f1135c3b3324ae50490de2804bedaec4d04ce50 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 13:35:05 +0200 Subject: [PATCH 40/95] Remove build from submit coverage --- .github/workflows/workflow.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 6fe1e4b6dc..02417ad7b5 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -159,7 +159,6 @@ jobs: with: path: ${{ env.pythonLocation }} key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} - - run: make build - name: Submit coverage to Coveralls run: | pip install coveralls From 24b6b2fe5ae6e67c3156335d5d70e3878257db8f Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 13:38:09 +0200 Subject: [PATCH 41/95] Remove circleci config --- .circleci/config.yml | 187 ---------------------- .circleci/get-numpy-version.py | 38 ----- .circleci/has-functional-changes.sh | 12 -- .circleci/is-version-number-acceptable.sh | 33 ---- .circleci/publish-git-tag.sh | 4 - .circleci/publish-python-package.sh | 4 - 6 files changed, 278 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100755 .circleci/get-numpy-version.py delete mode 100755 .circleci/has-functional-changes.sh delete mode 100755 .circleci/is-version-number-acceptable.sh delete mode 100755 .circleci/publish-git-tag.sh delete mode 100755 .circleci/publish-python-package.sh diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 67c45002e0..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,187 +0,0 @@ -version: 2 -jobs: - run_tests: - docker: - - image: python:3.7 - environment: - TERM: xterm-256color # To colorize output of make tasks. - - steps: - - checkout - - - restore_cache: - key: v1-py3-{{ .Branch }}-{{ checksum "setup.py" }} - - - run: - name: Create a virtualenv - command: | - mkdir -p /tmp/venv/openfisca_core - python -m venv /tmp/venv/openfisca_core - echo "source /tmp/venv/openfisca_core/bin/activate" >> $BASH_ENV - - - run: - name: Install dependencies - command: | - make install - make clean - # pip install --editable git+https://github.com/openfisca/country-template.git@BRANCH_NAME#egg=OpenFisca-Country-Template # use a specific branch of OpenFisca-Country-Template - # pip install --editable git+https://github.com/openfisca/extension-template.git@BRANCH_NAME#egg=OpenFisca-Extension-Template # use a specific branch of OpenFisca-Extension-Template - - - save_cache: - key: v1-py3-{{ .Branch }}-{{ checksum "setup.py" }} - paths: - - /tmp/venv/openfisca_core - - - run: - name: Run linters - command: make lint - - - run: - name: Run openfisca-core tests - command: make test-core pytest_args="--exitfirst" - - - run: - name: Run country-template tests - command: make test-country pytest_args="--exitfirst" - - - run: - name: Run extension-template tests - command: make test-extension pytest_args="--exitfirst" - - - run: - name: Check NumPy typing against latest 3 minor versions - command: for i in {1..3}; do VERSION=$(.circleci/get-numpy-version.py prev) && pip install numpy==$VERSION && make check-types; done - - - persist_to_workspace: - root: . - paths: - - .coverage - - test_docs: - docker: - - image: python:3.7 - environment: - TERM: xterm-256color # To colorize output of make tasks. - - steps: - - checkout - - - run: - name: Checkout docs - command: make test-doc-checkout branch=$CIRCLE_BRANCH - - - restore_cache: - key: v1-py3-{{ .Branch }}-{{ checksum "setup.py" }} - - - restore_cache: - key: v1-py3-docs-{{ .Branch }}-{{ checksum "doc/requirements.txt" }} - - - run: - name: Create a virtualenv - command: | - mkdir -p /tmp/venv/openfisca_doc - python -m venv /tmp/venv/openfisca_doc - echo "source /tmp/venv/openfisca_doc/bin/activate" >> $BASH_ENV - - - run: - name: Install dependencies - command: make test-doc-install - - - save_cache: - key: v1-py3-docs-{{ .Branch }}-{{ checksum "doc/requirements.txt" }} - paths: - - /tmp/venv/openfisca_doc - - - run: - name: Run doc tests - command: make test-doc-build - - - check_version: - docker: - - image: python:3.7 - - steps: - - checkout - - - run: - name: Check version number has been properly updated - command: | - git fetch - .circleci/is-version-number-acceptable.sh - - submit_coverage: - docker: - - image: python:3.7 - - steps: - - checkout - - - attach_workspace: - at: . - - - restore_cache: - key: v1-py3-{{ .Branch }}-{{ checksum "setup.py" }} - - - run: - name: Submit coverage to Coveralls - command: | - source /tmp/venv/openfisca_core/bin/activate - pip install coveralls - coveralls - - - save_cache: - key: v1-py3-{{ .Branch }}-{{ checksum "setup.py" }} - paths: - - /tmp/venv/openfisca_core - - deploy: - docker: - - image: python:3.7 - environment: - PYPI_USERNAME: openfisca-bot - # PYPI_PASSWORD: this value is set in CircleCI's web interface; do not set it here, it is a secret! - - steps: - - checkout - - - restore_cache: - key: v1-py3-{{ .Branch }}-{{ checksum "setup.py" }} - - - run: - name: Check for functional changes - command: if ! .circleci/has-functional-changes.sh ; then circleci step halt ; fi - - - run: - name: Upload a Python package to Pypi - command: | - source /tmp/venv/openfisca_core/bin/activate - .circleci/publish-python-package.sh - - - run: - name: Publish a git tag - command: .circleci/publish-git-tag.sh - - - run: - name: Update doc - command: | - curl -X POST --header "Content-Type: application/json" -d '{"branch":"master"}' https://circleci.com/api/v1.1/project/github/openfisca/openfisca-doc/build?circle-token=$CIRCLE_TOKEN - -workflows: - version: 2 - build_and_deploy: - jobs: - - run_tests - - test_docs - - check_version - - submit_coverage: - requires: - - run_tests - - deploy: - requires: - - run_tests - - test_docs - - check_version - filters: - branches: - only: master diff --git a/.circleci/get-numpy-version.py b/.circleci/get-numpy-version.py deleted file mode 100755 index 64cb68532e..0000000000 --- a/.circleci/get-numpy-version.py +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/env python - -from __future__ import annotations - -import os -import sys -import typing -from packaging import version -from typing import NoReturn, Union - -import numpy - -if typing.TYPE_CHECKING: - from packaging.version import LegacyVersion, Version - - -def prev() -> NoReturn: - release = _installed().release - - if release is None: - sys.exit(os.EX_DATAERR) - - major, minor, _ = release - - if minor == 0: - sys.exit(os.EX_DATAERR) - - minor -= 1 - print(f"{major}.{minor}.0") # noqa: T001 - sys.exit(os.EX_OK) - - -def _installed() -> Union[LegacyVersion, Version]: - return version.parse(numpy.__version__) - - -if __name__ == "__main__": - globals()[sys.argv[1]]() diff --git a/.circleci/has-functional-changes.sh b/.circleci/has-functional-changes.sh deleted file mode 100755 index b591716932..0000000000 --- a/.circleci/has-functional-changes.sh +++ /dev/null @@ -1,12 +0,0 @@ -#! /usr/bin/env bash - -IGNORE_DIFF_ON="README.md CONTRIBUTING.md Makefile .gitignore LICENSE* .circleci/* .github/* openfisca_tasks/*.mk tasks/*.mk tests/*" - -last_tagged_commit=`git describe --tags --abbrev=0 --first-parent` # --first-parent ensures we don't follow tags not published in master through an unlikely intermediary merge commit - -if git diff-index --name-only --exit-code $last_tagged_commit -- . `echo " $IGNORE_DIFF_ON" | sed 's/ / :(exclude)/g'` # Check if any file that has not be listed in IGNORE_DIFF_ON has changed since the last tag was published. -then - echo "No functional changes detected." - exit 1 -else echo "The functional files above were changed." -fi diff --git a/.circleci/is-version-number-acceptable.sh b/.circleci/is-version-number-acceptable.sh deleted file mode 100755 index ae370e2a17..0000000000 --- a/.circleci/is-version-number-acceptable.sh +++ /dev/null @@ -1,33 +0,0 @@ -#! /usr/bin/env bash - -if [[ $CIRCLE_BRANCH == master ]] -then - echo "No need for a version check on master." - exit 0 -fi - -if ! $(dirname "$BASH_SOURCE")/has-functional-changes.sh -then - echo "No need for a version update." - exit 0 -fi - -current_version=`python setup.py --version` - -if git rev-parse --verify --quiet $current_version -then - echo "Version $current_version already exists in commit:" - git --no-pager log -1 $current_version - echo - echo "Update the version number in setup.py before merging this branch into master." - echo "Look at the CONTRIBUTING.md file to learn how the version number should be updated." - exit 1 -fi - -if ! $(dirname "$BASH_SOURCE")/has-functional-changes.sh | grep --quiet CHANGELOG.md -then - echo "CHANGELOG.md has not been modified, while functional changes were made." - echo "Explain what you changed before merging this branch into master." - echo "Look at the CONTRIBUTING.md file to learn how to write the changelog." - exit 2 -fi diff --git a/.circleci/publish-git-tag.sh b/.circleci/publish-git-tag.sh deleted file mode 100755 index 4450357cbc..0000000000 --- a/.circleci/publish-git-tag.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /usr/bin/env bash - -git tag `python setup.py --version` -git push --tags # update the repository version diff --git a/.circleci/publish-python-package.sh b/.circleci/publish-python-package.sh deleted file mode 100755 index 8d331bd946..0000000000 --- a/.circleci/publish-python-package.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /usr/bin/env bash - -python setup.py bdist_wheel # build this package in the dist directory -twine upload dist/* --username $PYPI_USERNAME --password $PYPI_PASSWORD # publish From a63919502b72f9bde7413149e8675ec6a58865cb Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 30 Sep 2021 13:58:44 +0200 Subject: [PATCH 42/95] Add Circle Token to env --- .github/workflows/workflow.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 02417ad7b5..0758455c63 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -199,7 +199,8 @@ jobs: needs: [ check-for-functional-changes ] env: PYPI_USERNAME: openfisca-bot - PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} # Add to GitHub secrets + CIRCLE_TOKEN: ${{ secrets.CIRCLE_TOKEN }} # Add to GitHub secrets steps: - uses: actions/checkout@v2 with: From 2b26fc23298f6648519621a7dd89261cd30852e8 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Fri, 1 Oct 2021 14:53:02 +0200 Subject: [PATCH 43/95] Change test-python name --- .github/workflows/workflow.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 0758455c63..2dea192524 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -30,7 +30,7 @@ jobs: path: dist key: ${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }}-${{ github.sha }} - test-python: + test-core: runs-on: ubuntu-latest needs: [ build ] steps: @@ -142,7 +142,7 @@ jobs: sumbit-coverage: runs-on: ubuntu-latest - needs: [ test-python, check-numpy, test-country-template, lint-files ] + needs: [ test-core, check-numpy, test-country-template, lint-files ] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: @@ -165,7 +165,7 @@ jobs: coveralls --service=github check-version: runs-on: ubuntu-latest - needs: [ test-python, check-numpy, test-country-template, test-docs, lint-files ] # Last job to run + needs: [ test-core, check-numpy, test-country-template, test-docs, lint-files ] # Last job to run steps: - uses: actions/checkout@v2 with: From 621b8492f64ab388ab02d7abcf275aaae2b7bcf9 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 20 Oct 2021 11:27:15 +0200 Subject: [PATCH 44/95] Rename cache keys --- .github/workflows/workflow.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 2dea192524..37133ad74e 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -17,18 +17,18 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} # Cache the entire build Python environment + key: build-${{ env.pythonLocation }}${{ hashFiles('setup.py') }}-${{ github.sha }} restore-keys: | - ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }} - ${{ env.pythonLocation }}-build- + build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }} + build-${{ env.pythonLocation }}- - name: Build package 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: ${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }}-${{ github.sha }} + key: release-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} test-core: runs-on: ubuntu-latest @@ -44,7 +44,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} + key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - name: Build package run: make build - name: Run Core tests @@ -64,7 +64,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} + key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - name: Check NumPy typing against latest 3 minor versions run: for i in {1..3}; do VERSION=$(${GITHUB_WORKSPACE}/.github/get-numpy-version.py prev) && pip install numpy==$VERSION && make check-types; done @@ -82,7 +82,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} + key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - name: Run Country Template tests run: | COUNTRY_TEMPLATE_PATH=`python -c "import openfisca_country_template; print(openfisca_country_template.CountryTaxBenefitSystem().get_package_metadata()['location'])"` @@ -104,13 +104,13 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} + key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - name: Cache docs id: restore-docs uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ github.ref }}${{ env.pythonLocation }}-docs-${{ hashFiles('doc/requirements.txt') }} + key: docs-${{ env.pythonLocation }}-${{ hashFiles('doc/requirements.txt') }}--${{ github.sha }} - name: Install dependencies run: make test-doc-install - name: Run doc tests @@ -132,7 +132,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} + key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - run: make check-syntax-errors - run: make check-style - name: Lint Python files @@ -158,7 +158,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} + key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - name: Submit coverage to Coveralls run: | pip install coveralls @@ -214,13 +214,13 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-build-${{ hashFiles('setup.py') }}-${{ github.sha }} - - 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: ${{ env.pythonLocation }}-build-release-${{ hashFiles('setup.py') }}-${{ github.sha }} + 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 From 319e96a48242d33b7c861982ea714c15d464bbbd Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 20 Oct 2021 11:29:40 +0200 Subject: [PATCH 45/95] Add Python patch --- .github/workflows/workflow.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 37133ad74e..470bd35c2d 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -11,13 +11,13 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.7.12 - name: Cache build id: restore-build uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: build-${{ env.pythonLocation }}${{ hashFiles('setup.py') }}-${{ github.sha }} + key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} restore-keys: | build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }} build-${{ env.pythonLocation }}- @@ -38,7 +38,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.7.12 - name: Cache build id: restore-build uses: actions/cache@v2 @@ -58,7 +58,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.7.12 - name: Cache build id: restore-build uses: actions/cache@v2 @@ -76,7 +76,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.7.12 - name: Cache build id: restore-build uses: actions/cache@v2 @@ -98,7 +98,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.7.12 - name: Cache build id: restore-build uses: actions/cache@v2 @@ -126,7 +126,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.7.12 - name: Cache build id: restore-build uses: actions/cache@v2 @@ -152,7 +152,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.7.12 - name: Cache build id: restore-build uses: actions/cache@v2 @@ -173,7 +173,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.7.12 - name: Check version number has been properly updated run: "${GITHUB_WORKSPACE}/.github/is-version-number-acceptable.sh" @@ -190,7 +190,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.7.12 - id: stop-early run: "${GITHUB_WORKSPACE}/.github/has-functional-changes.sh" @@ -208,7 +208,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.7.12 - name: Cache build id: restore-build uses: actions/cache@v2 From 52c752974a152e617ef77b71ee67e230b092ef20 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Fri, 22 Oct 2021 17:52:56 +0200 Subject: [PATCH 46/95] Add comments --- .github/workflows/workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 470bd35c2d..4b877ab1fb 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -11,14 +11,14 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7.12 + python-version: 3.7.12 # Patch version must be specified to avoid any cache confusion, since the cache key depends on the full Python version. Any potentiel difference in patches between jobs will lead to a cache not found error. - name: Cache build id: restore-build uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - restore-keys: | + 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 From 9cb521da69609a5ee2cca9182ec2d704fcd52dfc Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Fri, 22 Oct 2021 17:54:48 +0200 Subject: [PATCH 47/95] Add new line --- .github/workflows/workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 4b877ab1fb..9e0a17686e 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -163,6 +163,7 @@ jobs: run: | pip install coveralls coveralls --service=github + check-version: runs-on: ubuntu-latest needs: [ test-core, check-numpy, test-country-template, test-docs, lint-files ] # Last job to run From 89b34fdc59b107c353baa0683fc3db93a3de4ebe Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Fri, 22 Oct 2021 17:59:54 +0200 Subject: [PATCH 48/95] Add step output condition to deploy --- .github/workflows/workflow.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 9e0a17686e..01198f37b3 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -193,11 +193,12 @@ jobs: with: python-version: 3.7.12 - id: stop-early - run: "${GITHUB_WORKSPACE}/.github/has-functional-changes.sh" + run: if "${GITHUB_WORKSPACE}/.github/has-functional-changes.sh" ; then echo "::set-output name=status::success" ; fi 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 }} # Add to GitHub secrets From 88c600f7710fa003c1d1509e53a31bc9e8684c73 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Fri, 22 Oct 2021 18:18:08 +0200 Subject: [PATCH 49/95] Remove build step from test-core --- .github/workflows/workflow.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 01198f37b3..cc5664d63a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -45,8 +45,6 @@ jobs: with: path: ${{ env.pythonLocation }} key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - - name: Build package - run: make build - name: Run Core tests run: env PYTEST_ADDOPTS="--exitfirst" make test From 50b05a887896e949d0e12334087edfe7e54090c7 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Fri, 22 Oct 2021 18:34:17 +0200 Subject: [PATCH 50/95] Move submit coverage step to test core job --- .github/workflows/workflow.yml | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index cc5664d63a..783b992ada 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -47,6 +47,10 @@ jobs: key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - name: Run Core tests run: env PYTEST_ADDOPTS="--exitfirst" make test + - name: Submit coverage to Coveralls + run: | + pip install coveralls + coveralls --service=github check-numpy: runs-on: ubuntu-latest @@ -89,6 +93,8 @@ jobs: test-docs: runs-on: ubuntu-latest needs: [ build ] + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 - name: Checkout docs @@ -138,30 +144,6 @@ jobs: - name: Lint YAML tests run: "${GITHUB_WORKSPACE}/.github/lint-changed-yaml-tests.sh" - sumbit-coverage: - runs-on: ubuntu-latest - needs: [ test-core, check-numpy, test-country-template, lint-files ] - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Fetch all the tags - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.7.12 - - name: Cache build - id: restore-build - uses: actions/cache@v2 - with: - path: ${{ env.pythonLocation }} - key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - - name: Submit coverage to Coveralls - run: | - pip install coveralls - coveralls --service=github - check-version: runs-on: ubuntu-latest needs: [ test-core, check-numpy, test-country-template, test-docs, lint-files ] # Last job to run From efcdb6299cadd8614f4fd0611a9ac156c49dc440 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Fri, 22 Oct 2021 18:38:36 +0200 Subject: [PATCH 51/95] Add GitHub Actions token to test core job --- .github/workflows/workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 783b992ada..6cfcb1b6c2 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -33,6 +33,8 @@ jobs: test-core: runs-on: ubuntu-latest needs: [ build ] + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 - name: Set up Python @@ -93,8 +95,6 @@ jobs: test-docs: runs-on: ubuntu-latest needs: [ build ] - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 - name: Checkout docs From 13a99f11649652cd446e7056cb1f487f84293476 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Fri, 22 Oct 2021 19:07:45 +0200 Subject: [PATCH 52/95] Change core test command --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 6cfcb1b6c2..6eac483088 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -48,7 +48,7 @@ jobs: path: ${{ env.pythonLocation }} key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - name: Run Core tests - run: env PYTEST_ADDOPTS="--exitfirst" make test + run: make test-core pytest_args="--exitfirst" - name: Submit coverage to Coveralls run: | pip install coveralls From 2ae236071075dd7ed004f58b665716b27779426a Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Fri, 22 Oct 2021 21:15:50 +0200 Subject: [PATCH 53/95] Add term to env --- .github/workflows/workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 6eac483088..692d281c66 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -35,6 +35,7 @@ jobs: needs: [ build ] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TERM: xterm-256color # To colorize output of make tasks. steps: - uses: actions/checkout@v2 - name: Set up Python From 98241c516248c2a6eafe926f1f47a041af7cda32 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Mon, 25 Oct 2021 08:29:15 +0200 Subject: [PATCH 54/95] Add build to test core --- .github/workflows/workflow.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 692d281c66..88879e29b4 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -48,6 +48,8 @@ jobs: with: path: ${{ env.pythonLocation }} key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} + - name: Build package + run: make build - name: Run Core tests run: make test-core pytest_args="--exitfirst" - name: Submit coverage to Coveralls From ef397fe5a9625ddd9ab6085df4e1d2d4a84031ee Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Mon, 25 Oct 2021 08:56:50 +0200 Subject: [PATCH 55/95] Remove build from test core --- .github/workflows/workflow.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 88879e29b4..692d281c66 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -48,8 +48,6 @@ jobs: with: path: ${{ env.pythonLocation }} key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - - name: Build package - run: make build - name: Run Core tests run: make test-core pytest_args="--exitfirst" - name: Submit coverage to Coveralls From 76ce8cff0712b87347982616189427cfa5547433 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 11:16:30 +0200 Subject: [PATCH 56/95] Add term to env --- .github/workflows/workflow.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 692d281c66..63e10735ff 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -5,6 +5,8 @@ on: [ push ] jobs: build: runs-on: ubuntu-latest + env: + TERM: xterm-256color # To colorize output of make tasks. steps: - name: Checkout uses: actions/checkout@v2 From 2533bba39f30d26717c45fafeeceab5e3594b47c Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 11:20:04 +0200 Subject: [PATCH 57/95] Replace linting scripts with make lint --- .github/lint-changed-python-files.sh | 11 ----------- .github/lint-changed-yaml-tests.sh | 11 ----------- .github/workflows/workflow.yml | 14 ++------------ 3 files changed, 2 insertions(+), 34 deletions(-) delete mode 100755 .github/lint-changed-python-files.sh delete mode 100755 .github/lint-changed-yaml-tests.sh diff --git a/.github/lint-changed-python-files.sh b/.github/lint-changed-python-files.sh deleted file mode 100755 index 72d8aad639..0000000000 --- a/.github/lint-changed-python-files.sh +++ /dev/null @@ -1,11 +0,0 @@ -#! /usr/bin/env bash - -last_tagged_commit=`git describe --tags --abbrev=0 --first-parent` # --first-parent ensures we don't follow tags not published in master through an unlikely intermediary merge commit - -if ! changes=$(git diff-index --name-only --diff-filter=ACMR --exit-code $last_tagged_commit -- "*.py") -then - echo "Linting the following Python files:" - echo $changes - flake8 $changes -else echo "No changed Python files to lint" -fi diff --git a/.github/lint-changed-yaml-tests.sh b/.github/lint-changed-yaml-tests.sh deleted file mode 100755 index 16e99432b6..0000000000 --- a/.github/lint-changed-yaml-tests.sh +++ /dev/null @@ -1,11 +0,0 @@ -#! /usr/bin/env bash - -last_tagged_commit=`git describe --tags --abbrev=0 --first-parent` # --first-parent ensures we don't follow tags not published in master through an unlikely intermediary merge commit - -if ! changes=$(git diff-index --name-only --diff-filter=ACMR --exit-code $last_tagged_commit -- "tests/*.yaml") -then - echo "Linting the following changed YAML tests:" - echo $changes - yamllint $changes -else echo "No changed YAML tests to lint" -fi diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 63e10735ff..b126e35eb3 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -134,18 +134,8 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.7.12 - - name: Cache build - id: restore-build - uses: actions/cache@v2 - with: - path: ${{ env.pythonLocation }} - key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - - run: make check-syntax-errors - - run: make check-style - - name: Lint Python files - run: "${GITHUB_WORKSPACE}/.github/lint-changed-python-files.sh" - - name: Lint YAML tests - run: "${GITHUB_WORKSPACE}/.github/lint-changed-yaml-tests.sh" + - name: Run linters + run: make lint check-version: runs-on: ubuntu-latest From ab8cbbcb419fc4f187ded120091f7b9a52714f06 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 11:23:25 +0200 Subject: [PATCH 58/95] Rename test core step --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index b126e35eb3..587d5691c2 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -50,7 +50,7 @@ jobs: with: path: ${{ env.pythonLocation }} key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - - name: Run Core tests + - name: Run openfisca-core tests run: make test-core pytest_args="--exitfirst" - name: Submit coverage to Coveralls run: | From 5bd0a088def5d638ecfc106db68262a833c9e99c Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 11:26:54 +0200 Subject: [PATCH 59/95] Replace country test command with make command --- .github/workflows/workflow.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 587d5691c2..e74255756e 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -57,7 +57,7 @@ jobs: pip install coveralls coveralls --service=github - check-numpy: + test-country-template: runs-on: ubuntu-latest needs: [ build ] steps: @@ -72,10 +72,10 @@ jobs: with: path: ${{ env.pythonLocation }} key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - - name: Check NumPy typing against latest 3 minor versions - run: for i in {1..3}; do VERSION=$(${GITHUB_WORKSPACE}/.github/get-numpy-version.py prev) && pip install numpy==$VERSION && make check-types; done + - name: Run Country Template tests + run: make test-country pytest_args="--exitfirst" - test-country-template: + check-numpy: runs-on: ubuntu-latest needs: [ build ] steps: @@ -90,10 +90,8 @@ jobs: with: path: ${{ env.pythonLocation }} key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - - name: Run Country Template tests - run: | - COUNTRY_TEMPLATE_PATH=`python -c "import openfisca_country_template; print(openfisca_country_template.CountryTaxBenefitSystem().get_package_metadata()['location'])"` - openfisca test $COUNTRY_TEMPLATE_PATH/openfisca_country_template/tests/ + - name: Check NumPy typing against latest 3 minor versions + run: for i in {1..3}; do VERSION=$(${GITHUB_WORKSPACE}/.github/get-numpy-version.py prev) && pip install numpy==$VERSION && make check-types; done test-docs: runs-on: ubuntu-latest From aaa094ccf797da27d91ba269e7852411cf179103 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 11:29:50 +0200 Subject: [PATCH 60/95] Add term to env for every job --- .github/workflows/workflow.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index e74255756e..44559e9d20 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -60,6 +60,8 @@ jobs: test-country-template: runs-on: ubuntu-latest needs: [ build ] + env: + TERM: xterm-256color steps: - uses: actions/checkout@v2 - name: Set up Python @@ -78,6 +80,8 @@ jobs: check-numpy: runs-on: ubuntu-latest needs: [ build ] + env: + TERM: xterm-256color steps: - uses: actions/checkout@v2 - name: Set up Python @@ -96,6 +100,8 @@ jobs: test-docs: runs-on: ubuntu-latest needs: [ build ] + env: + TERM: xterm-256color steps: - uses: actions/checkout@v2 - name: Checkout docs @@ -124,6 +130,8 @@ jobs: lint-files: runs-on: ubuntu-latest needs: [ build ] + env: + TERM: xterm-256color steps: - uses: actions/checkout@v2 with: @@ -138,6 +146,8 @@ jobs: check-version: runs-on: ubuntu-latest needs: [ test-core, check-numpy, test-country-template, test-docs, lint-files ] # Last job to run + env: + TERM: xterm-256color steps: - uses: actions/checkout@v2 with: @@ -153,6 +163,8 @@ jobs: runs-on: ubuntu-latest if: github.ref == 'refs/heads/master' # Only triggered for the `master` branch needs: [ check-version ] + env: + TERM: xterm-256color outputs: status: ${{ steps.stop-early.outputs.status }} steps: @@ -174,6 +186,7 @@ jobs: PYPI_USERNAME: openfisca-bot PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} # Add to GitHub secrets CIRCLE_TOKEN: ${{ secrets.CIRCLE_TOKEN }} # Add to GitHub secrets + TERM: xterm-256color steps: - uses: actions/checkout@v2 with: From 75e02a3f013a814a8ccdacf609e5adb2eb2d0184 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 11:30:43 +0200 Subject: [PATCH 61/95] Add build cache to linting job --- .github/workflows/workflow.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 44559e9d20..3707a9c36b 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -140,6 +140,12 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.7.12 + - name: Cache build + id: restore-build + uses: actions/cache@v2 + with: + path: ${{ env.pythonLocation }} + key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - name: Run linters run: make lint From aa7546dd29cced1e3d23763566c18411422f433e Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 11:44:46 +0200 Subject: [PATCH 62/95] Test install instead of build --- .github/workflows/workflow.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 3707a9c36b..09ce543a7b 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -24,13 +24,9 @@ jobs: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }} build-${{ env.pythonLocation }}- - name: Build package - run: make build - - name: Cache release - id: restore-release - uses: actions/cache@v2 - with: - path: dist - key: release-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} + run: | + make install + make clean test-core: runs-on: ubuntu-latest From c6738894685e9c7f747bbdf8216b12789485d884 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 11:50:23 +0200 Subject: [PATCH 63/95] Remove make clean from build job --- .github/workflows/workflow.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 09ce543a7b..adee883b7f 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -26,7 +26,6 @@ jobs: - name: Build package run: | make install - make clean test-core: runs-on: ubuntu-latest From e9d116e26d2d6ff570a8d9541e5a4f34fd3f9717 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 12:03:16 +0200 Subject: [PATCH 64/95] Replace install with build --- .github/workflows/workflow.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index adee883b7f..3707a9c36b 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -24,8 +24,13 @@ jobs: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }} build-${{ env.pythonLocation }}- - name: Build package - run: | - make install + run: make build + - name: Cache release + id: restore-release + uses: actions/cache@v2 + with: + path: dist + key: release-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} test-core: runs-on: ubuntu-latest From 0a9714e984ec61245557a84ea6cc9ebfa132b475 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 12:06:27 +0200 Subject: [PATCH 65/95] Add test extension template job --- .github/workflows/workflow.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 3707a9c36b..25ded4c036 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -77,6 +77,26 @@ jobs: - name: Run Country Template tests run: make test-country pytest_args="--exitfirst" + test-extension-template: + runs-on: ubuntu-latest + needs: [ build ] + env: + TERM: xterm-256color + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.7.12 + - name: Cache build + id: restore-build + uses: actions/cache@v2 + with: + path: ${{ env.pythonLocation }} + key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} + - name: Run Extension Template tests + run: make test-extension pytest_args="--exitfirst" + check-numpy: runs-on: ubuntu-latest needs: [ build ] From 151c5cf09fe05722783fa86206108c994a2d7206 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 12:16:27 +0200 Subject: [PATCH 66/95] Delete publish python package script --- .github/publish-python-package.sh | 4 ---- 1 file changed, 4 deletions(-) delete mode 100755 .github/publish-python-package.sh diff --git a/.github/publish-python-package.sh b/.github/publish-python-package.sh deleted file mode 100755 index 8d331bd946..0000000000 --- a/.github/publish-python-package.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /usr/bin/env bash - -python setup.py bdist_wheel # build this package in the dist directory -twine upload dist/* --username $PYPI_USERNAME --password $PYPI_PASSWORD # publish From dd29e5c6e4ae620fd09bb4a39095836c4c0d73b4 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 12:22:34 +0200 Subject: [PATCH 67/95] Add test extension to check version requirements --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 25ded4c036..4fb1e8c375 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -171,7 +171,7 @@ jobs: check-version: runs-on: ubuntu-latest - needs: [ test-core, check-numpy, test-country-template, test-docs, lint-files ] # Last job to run + needs: [ test-core, check-numpy, test-country-template, test-extension-template, test-docs, lint-files ] # Last job to run env: TERM: xterm-256color steps: From 3c6e7c656ff8f3fb331abee91636eec5827dfdcf Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 12:49:23 +0200 Subject: [PATCH 68/95] Remove unnecessary term mentions in env --- .github/workflows/workflow.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 4fb1e8c375..89b90132e7 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -171,9 +171,7 @@ jobs: check-version: runs-on: ubuntu-latest - needs: [ test-core, check-numpy, test-country-template, test-extension-template, test-docs, lint-files ] # Last job to run - env: - TERM: xterm-256color + needs: [ test-core, test-country-template, test-extension-template, check-numpy, test-docs, lint-files ] # Last job to run steps: - uses: actions/checkout@v2 with: @@ -189,8 +187,6 @@ jobs: runs-on: ubuntu-latest if: github.ref == 'refs/heads/master' # Only triggered for the `master` branch needs: [ check-version ] - env: - TERM: xterm-256color outputs: status: ${{ steps.stop-early.outputs.status }} steps: @@ -212,7 +208,6 @@ jobs: PYPI_USERNAME: openfisca-bot PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} # Add to GitHub secrets CIRCLE_TOKEN: ${{ secrets.CIRCLE_TOKEN }} # Add to GitHub secrets - TERM: xterm-256color steps: - uses: actions/checkout@v2 with: From 76f38ed52b9c9e84da00d1ff28aa25b189460296 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 15:01:47 +0200 Subject: [PATCH 69/95] Extend ignore diff on to tasks --- .github/has-functional-changes.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/has-functional-changes.sh b/.github/has-functional-changes.sh index 15706e8a1b..bf1270989a 100755 --- a/.github/has-functional-changes.sh +++ b/.github/has-functional-changes.sh @@ -1,6 +1,6 @@ #! /usr/bin/env bash -IGNORE_DIFF_ON="README.md CONTRIBUTING.md Makefile .gitignore LICENSE* .github/* tests/*" +IGNORE_DIFF_ON="README.md CONTRIBUTING.md Makefile .gitignore LICENSE* .github/* tests/* openfisca_tasks/*.mk tasks/*.mk" last_tagged_commit=`git describe --tags --abbrev=0 --first-parent` # --first-parent ensures we don't follow tags not published in master through an unlikely intermediary merge commit From 8d90013b6cb5a9d18c7514211fca4ac30db5bdbe Mon Sep 17 00:00:00 2001 From: Hajar AIT EL KADI <48837850+HAEKADI@users.noreply.github.com> Date: Tue, 26 Oct 2021 15:04:10 +0200 Subject: [PATCH 70/95] Delete extra space Co-authored-by: Matti Schneider --- .github/is-version-number-acceptable.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/is-version-number-acceptable.sh b/.github/is-version-number-acceptable.sh index f4fb2c1bcf..0f704a93fe 100755 --- a/.github/is-version-number-acceptable.sh +++ b/.github/is-version-number-acceptable.sh @@ -1,6 +1,6 @@ #! /usr/bin/env bash -if [[ ${GITHUB_REF#refs/heads/} == master ]] +if [[ ${GITHUB_REF#refs/heads/} == master ]] then echo "No need for a version check on master." exit 0 From da6e52aeeb7a50b13ad80d085da96cc1d3e978a1 Mon Sep 17 00:00:00 2001 From: Hajar AIT EL KADI <48837850+HAEKADI@users.noreply.github.com> Date: Tue, 26 Oct 2021 15:04:58 +0200 Subject: [PATCH 71/95] Improve comment phrasing Co-authored-by: Matti Schneider --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 89b90132e7..45bfc68a73 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -13,7 +13,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.7.12 # Patch version must be specified to avoid any cache confusion, since the cache key depends on the full Python version. Any potentiel difference in patches between jobs will lead to a cache not found error. + python-version: 3.7.12 # Patch version must be specified to avoid any cache confusion, since the cache key depends on the full Python version. If left unspecified, different patch versions could be allocated between jobs, and any such difference would lead to a cache not found error. - name: Cache build id: restore-build uses: actions/cache@v2 From 3652b30b0c3d73c252817ef44ee118e7b51b425d Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 15:14:02 +0200 Subject: [PATCH 72/95] Remove stop execution on first failure argument --- .github/workflows/workflow.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 45bfc68a73..733312612d 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -51,7 +51,7 @@ jobs: path: ${{ env.pythonLocation }} key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - name: Run openfisca-core tests - run: make test-core pytest_args="--exitfirst" + run: make test-core - name: Submit coverage to Coveralls run: | pip install coveralls @@ -75,7 +75,7 @@ jobs: path: ${{ env.pythonLocation }} key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - name: Run Country Template tests - run: make test-country pytest_args="--exitfirst" + run: make test-country test-extension-template: runs-on: ubuntu-latest @@ -95,7 +95,7 @@ jobs: path: ${{ env.pythonLocation }} key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} - name: Run Extension Template tests - run: make test-extension pytest_args="--exitfirst" + run: make test-extension check-numpy: runs-on: ubuntu-latest From a32ba03d89f727c2a7b13b1207779cb813afa3ec Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 15:37:26 +0200 Subject: [PATCH 73/95] Add comments to check-for-functional-changes job --- .github/workflows/workflow.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 733312612d..969f42f296 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -183,6 +183,9 @@ jobs: - name: Check version number has been properly updated run: "${GITHUB_WORKSPACE}/.github/is-version-number-acceptable.sh" + # GitHub Actions does not have a halt job option, to stop from deploying if no functional changes were found. + # We build a separate job to substitute the halt option. + # The `deploy` job is dependent on the output of the `check-for-functional-changes`job. check-for-functional-changes: runs-on: ubuntu-latest if: github.ref == 'refs/heads/master' # Only triggered for the `master` branch @@ -198,7 +201,7 @@ 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: if "${GITHUB_WORKSPACE}/.github/has-functional-changes.sh" ; then echo "::set-output name=status::success" ; fi # The `check-for-functional-changes` job should always succeed regardless of the `has-functional-changes` script's exit code. Consequently, we do not use that exit code to trigger deploy, but rather a dedicated output variable `status`, to avoid a job failure if the exit code is different from 0. deploy: runs-on: ubuntu-latest From 32034cda81e041e2f0c65694c42eb87e4a03ff05 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 15:40:32 +0200 Subject: [PATCH 74/95] Add CircleCI doc token --- .github/workflows/workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 969f42f296..f880ba30aa 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -209,8 +209,8 @@ jobs: if: needs.check-for-functional-changes.outputs.status == 'success' env: PYPI_USERNAME: openfisca-bot - PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} # Add to GitHub secrets - CIRCLE_TOKEN: ${{ secrets.CIRCLE_TOKEN }} # Add to GitHub secrets + PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + CIRCLE_TOKEN: ${{ secrets.CIRCLECI_OPENFISCADOC_TOKEN }} steps: - uses: actions/checkout@v2 with: From 8c8393daf3e7231d8e7a9c5ccd5462afd83f1570 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 15:50:58 +0200 Subject: [PATCH 75/95] Test deploy for this branch --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index f880ba30aa..9e192560aa 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -188,7 +188,7 @@ jobs: # The `deploy` job is dependent on the output of the `check-for-functional-changes`job. check-for-functional-changes: runs-on: ubuntu-latest - if: github.ref == 'refs/heads/master' # Only triggered for the `master` branch + if: github.ref == 'refs/heads/github-actions' # Only triggered for the `master` branch needs: [ check-version ] outputs: status: ${{ steps.stop-early.outputs.status }} From 2b5d1996e7bc2bc9d5ef9c1bdc09b164697b6961 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 15:55:13 +0200 Subject: [PATCH 76/95] Update CHANGELOG and setup --- CHANGELOG.md | 6 ++++++ setup.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27d95ddaa3..0f3787cd9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 35.8.0-beta.1 [#1057](https://github.com/openfisca/openfisca-core/pull/1057) + +#### Technical changes + +- Switch CI provider from CircleCI to GitHub Actions + ### 35.7.1 [#1075](https://github.com/openfisca/openfisca-core/pull/1075) #### Bug fix diff --git a/setup.py b/setup.py index 36e30a751e..20958c1df1 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ setup( name = 'OpenFisca-Core', - version = '35.7.1', + version = '35.8.0-beta.1', author = 'OpenFisca Team', author_email = 'contact@openfisca.org', classifiers = [ From 41c5f8cdd5bf54c2643e08aa843fcd2cdeccbb19 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 16:10:15 +0200 Subject: [PATCH 77/95] Test updating doc on this branch --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 9e192560aa..dca28baf72 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -237,4 +237,4 @@ jobs: run: "${GITHUB_WORKSPACE}/.github/publish-git-tag.sh" - name: Update doc run: | - curl -X POST --header 'Content-Type: application/json' -d '{"branch":"master"}' https://circleci.com/api/v1.1/project/github/openfisca/openfisca-doc/build?circle-token=$CIRCLE_TOKEN + curl -X POST --header 'Content-Type: application/json' -d '{"branch":"github-actions"}' https://circleci.com/api/v1.1/project/github/openfisca/openfisca-doc/build?circle-token=$CIRCLE_TOKEN From 3bac99e3746a9372f1dfa9f57346c095717b803f Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 26 Oct 2021 16:28:53 +0200 Subject: [PATCH 78/95] Update check-for-functional-changes job comments --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index dca28baf72..a266158ad6 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -201,7 +201,7 @@ 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 # The `check-for-functional-changes` job should always succeed regardless of the `has-functional-changes` script's exit code. Consequently, we do not use that exit code to trigger deploy, but rather a dedicated output variable `status`, to avoid a job failure if the exit code is different from 0. + run: if "${GITHUB_WORKSPACE}/.github/has-functional-changes.sh" ; then echo "::set-output name=status::success" ; fi # The `check-for-functional-changes` job should always succeed regardless of the `has-functional-changes` script's exit code. Consequently, we do not use that exit code to trigger deploy, but rather a dedicated output variable `status`, to avoid a job failure if the exit code is different from 0. Conversely, if the job fails the entire workflow would be marked as `failed` which is disturbing for contributors. deploy: runs-on: ubuntu-latest From 9f9e1ef6af42b0446509ecb8be3212da2f2a45af Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 27 Oct 2021 10:33:20 +0200 Subject: [PATCH 79/95] Update CircleCI API version to v2 --- .github/workflows/workflow.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index a266158ad6..93b0483008 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -211,6 +211,7 @@ jobs: PYPI_USERNAME: openfisca-bot PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} CIRCLE_TOKEN: ${{ secrets.CIRCLECI_OPENFISCADOC_TOKEN }} + CIRCLE_BRANCH: ${{ github.head_ref }} steps: - uses: actions/checkout@v2 with: @@ -237,4 +238,9 @@ jobs: run: "${GITHUB_WORKSPACE}/.github/publish-git-tag.sh" - name: Update doc run: | - curl -X POST --header 'Content-Type: application/json' -d '{"branch":"github-actions"}' https://circleci.com/api/v1.1/project/github/openfisca/openfisca-doc/build?circle-token=$CIRCLE_TOKEN + curl -X POST \ + -H 'Circle-Token: $CIRCLE_TOKEN' \ + -H 'Content-Type: application/json' \ + -H 'Accept: application/json' \ + -d "{\"branch\":\"${CIRCLE_BRANCH}\"} \ + https://circleci.com/api/v2/project/github/openfisca/openfisca-doc/build From 72334e58dc674b0ea7bed6e4ccc0fc0aaecfa98e Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 28 Oct 2021 08:45:02 +0200 Subject: [PATCH 80/95] Add missing quotation --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 93b0483008..ea99b96312 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -242,5 +242,5 @@ jobs: -H 'Circle-Token: $CIRCLE_TOKEN' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ - -d "{\"branch\":\"${CIRCLE_BRANCH}\"} \ + -d "{\"branch\":\"${CIRCLE_BRANCH}\"}" \ https://circleci.com/api/v2/project/github/openfisca/openfisca-doc/build From 884929e500ed6312556e50983b493e6a68935a7a Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 28 Oct 2021 09:12:55 +0200 Subject: [PATCH 81/95] Replace CircleCI token with personnal token --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index ea99b96312..a7856e9d7d 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -210,7 +210,7 @@ jobs: env: PYPI_USERNAME: openfisca-bot PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - CIRCLE_TOKEN: ${{ secrets.CIRCLECI_OPENFISCADOC_TOKEN }} + CIRCLE_TOKEN: ${{ secrets.CIRCLECI_V1_OPENFISCADOC_TOKEN }} CIRCLE_BRANCH: ${{ github.head_ref }} steps: - uses: actions/checkout@v2 From 4614b6d30071e1dc9af6b96a196554c0ee7deb4b Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 28 Oct 2021 09:13:31 +0200 Subject: [PATCH 82/95] Update CHANGELOG and setup --- CHANGELOG.md | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f3787cd9e..744f7aae4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 35.8.0-beta.1 [#1057](https://github.com/openfisca/openfisca-core/pull/1057) +## 35.8.0-beta.2 [#1057](https://github.com/openfisca/openfisca-core/pull/1057) #### Technical changes diff --git a/setup.py b/setup.py index 20958c1df1..a905d1d3d2 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ setup( name = 'OpenFisca-Core', - version = '35.8.0-beta.1', + version = '35.8.0-beta.2', author = 'OpenFisca Team', author_email = 'contact@openfisca.org', classifiers = [ From 63951bebd03cca34887a907b0a4416cb2cebfee6 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 28 Oct 2021 10:36:58 +0200 Subject: [PATCH 83/95] Replace CircleCI API v2 with v1 --- .github/workflows/workflow.yml | 7 +------ CHANGELOG.md | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index a7856e9d7d..486f6492f7 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -238,9 +238,4 @@ jobs: run: "${GITHUB_WORKSPACE}/.github/publish-git-tag.sh" - name: Update doc run: | - curl -X POST \ - -H 'Circle-Token: $CIRCLE_TOKEN' \ - -H 'Content-Type: application/json' \ - -H 'Accept: application/json' \ - -d "{\"branch\":\"${CIRCLE_BRANCH}\"}" \ - https://circleci.com/api/v2/project/github/openfisca/openfisca-doc/build + curl -X POST --header 'Content-Type: application/json' -d '{"branch":"github-actions"}' https://circleci.com/api/v1.1/project/github/openfisca/openfisca-doc/build?circle-token=$CIRCLE_TOKEN diff --git a/CHANGELOG.md b/CHANGELOG.md index 744f7aae4d..4192b5d439 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 35.8.0-beta.2 [#1057](https://github.com/openfisca/openfisca-core/pull/1057) +## 35.8.0-beta.3 [#1057](https://github.com/openfisca/openfisca-core/pull/1057) #### Technical changes diff --git a/setup.py b/setup.py index a905d1d3d2..477de9e692 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ setup( name = 'OpenFisca-Core', - version = '35.8.0-beta.2', + version = '35.8.0-beta.3', author = 'OpenFisca Team', author_email = 'contact@openfisca.org', classifiers = [ From 1369f482728666c661545109e9b2fa1b090127eb Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 28 Oct 2021 10:43:45 +0200 Subject: [PATCH 84/95] Update branch name --- .github/workflows/workflow.yml | 2 +- CHANGELOG.md | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 486f6492f7..073db85a3d 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -238,4 +238,4 @@ jobs: run: "${GITHUB_WORKSPACE}/.github/publish-git-tag.sh" - name: Update doc run: | - curl -X POST --header 'Content-Type: application/json' -d '{"branch":"github-actions"}' https://circleci.com/api/v1.1/project/github/openfisca/openfisca-doc/build?circle-token=$CIRCLE_TOKEN + curl -X POST --header 'Content-Type: application/json' -d '{\"branch\":\"${CIRCLE_BRANCH}\"}' https://circleci.com/api/v1.1/project/github/openfisca/openfisca-doc/build?circle-token=$CIRCLE_TOKEN diff --git a/CHANGELOG.md b/CHANGELOG.md index 4192b5d439..b127c6a35a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 35.8.0-beta.3 [#1057](https://github.com/openfisca/openfisca-core/pull/1057) +## 35.8.0-beta.4 [#1057](https://github.com/openfisca/openfisca-core/pull/1057) #### Technical changes diff --git a/setup.py b/setup.py index 477de9e692..e12a9c2670 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ setup( name = 'OpenFisca-Core', - version = '35.8.0-beta.3', + version = '35.8.0-beta.4', author = 'OpenFisca Team', author_email = 'contact@openfisca.org', classifiers = [ From bfbe88030f1d301d69af9ed8ef385c8c93580fb8 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 28 Oct 2021 10:52:44 +0200 Subject: [PATCH 85/95] Change content type format --- .github/workflows/workflow.yml | 2 +- CHANGELOG.md | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 073db85a3d..e5c295ac99 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -238,4 +238,4 @@ jobs: run: "${GITHUB_WORKSPACE}/.github/publish-git-tag.sh" - name: Update doc run: | - curl -X POST --header 'Content-Type: application/json' -d '{\"branch\":\"${CIRCLE_BRANCH}\"}' https://circleci.com/api/v1.1/project/github/openfisca/openfisca-doc/build?circle-token=$CIRCLE_TOKEN + curl -X POST --header "Content-Type: application/json" -d "branch: $CIRCLE_BRANCH" --url https://circleci.com/api/v1.1/project/github/openfisca/openfisca-doc/build?circle-token=$CIRCLE_TOKEN diff --git a/CHANGELOG.md b/CHANGELOG.md index b127c6a35a..729abbf58e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 35.8.0-beta.4 [#1057](https://github.com/openfisca/openfisca-core/pull/1057) +## 35.8.0-beta.5 [#1057](https://github.com/openfisca/openfisca-core/pull/1057) #### Technical changes diff --git a/setup.py b/setup.py index e12a9c2670..a2629fc114 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ setup( name = 'OpenFisca-Core', - version = '35.8.0-beta.4', + version = '35.8.0-beta.5', author = 'OpenFisca Team', author_email = 'contact@openfisca.org', classifiers = [ From 57afac87f44db74bafd3566d2c6af708dc405569 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 28 Oct 2021 11:04:12 +0200 Subject: [PATCH 86/95] Use master branch for doc --- .github/workflows/workflow.yml | 3 +-- CHANGELOG.md | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index e5c295ac99..f0261ec469 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -211,7 +211,6 @@ jobs: PYPI_USERNAME: openfisca-bot PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} CIRCLE_TOKEN: ${{ secrets.CIRCLECI_V1_OPENFISCADOC_TOKEN }} - CIRCLE_BRANCH: ${{ github.head_ref }} steps: - uses: actions/checkout@v2 with: @@ -238,4 +237,4 @@ jobs: run: "${GITHUB_WORKSPACE}/.github/publish-git-tag.sh" - name: Update doc run: | - curl -X POST --header "Content-Type: application/json" -d "branch: $CIRCLE_BRANCH" --url https://circleci.com/api/v1.1/project/github/openfisca/openfisca-doc/build?circle-token=$CIRCLE_TOKEN + curl -X POST --header "Content-Type: application/json" -d '{"branch":"master"}' https://circleci.com/api/v1.1/project/github/openfisca/openfisca-doc/build?circle-token=$CIRCLE_TOKEN diff --git a/CHANGELOG.md b/CHANGELOG.md index 729abbf58e..d78160d177 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 35.8.0-beta.5 [#1057](https://github.com/openfisca/openfisca-core/pull/1057) +## 35.8.0-beta.6 [#1057](https://github.com/openfisca/openfisca-core/pull/1057) #### Technical changes diff --git a/setup.py b/setup.py index a2629fc114..3caed496ed 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ setup( name = 'OpenFisca-Core', - version = '35.8.0-beta.5', + version = '35.8.0-beta.6', author = 'OpenFisca Team', author_email = 'contact@openfisca.org', classifiers = [ From 66afdb494ac149d2350b3fe5d209dfcae8f01fe1 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 28 Oct 2021 17:25:18 +0200 Subject: [PATCH 87/95] Update master branch condition to deploy --- .github/workflows/workflow.yml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index f0261ec469..ac882733f4 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -188,7 +188,7 @@ jobs: # The `deploy` job is dependent on the output of the `check-for-functional-changes`job. check-for-functional-changes: runs-on: ubuntu-latest - if: github.ref == 'refs/heads/github-actions' # Only triggered for the `master` branch + if: github.ref == 'refs/heads/master' # Only triggered for the `master` branch needs: [ check-version ] outputs: status: ${{ steps.stop-early.outputs.status }} diff --git a/setup.py b/setup.py index 3caed496ed..6b4ef20dcf 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ setup( name = 'OpenFisca-Core', - version = '35.8.0-beta.6', + version = '35.8.0', author = 'OpenFisca Team', author_email = 'contact@openfisca.org', classifiers = [ From 2f0e3ddac6aa70f78caf5b639f233e57131e1e68 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 28 Oct 2021 17:27:17 +0200 Subject: [PATCH 88/95] Add CircleCI API toekn comment --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index ac882733f4..f2823a0640 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -210,7 +210,7 @@ jobs: env: PYPI_USERNAME: openfisca-bot PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - CIRCLE_TOKEN: ${{ secrets.CIRCLECI_V1_OPENFISCADOC_TOKEN }} + CIRCLE_TOKEN: ${{ secrets.CIRCLECI_V1_OPENFISCADOC_TOKEN }} # Personal API token created in CircleCI to grant full read and write permissions steps: - uses: actions/checkout@v2 with: From dcd7005f0cc245d2f1d5779786bb43f232ef3307 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Thu, 28 Oct 2021 17:30:33 +0200 Subject: [PATCH 89/95] Update CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d78160d177..fac165eb76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 35.8.0-beta.6 [#1057](https://github.com/openfisca/openfisca-core/pull/1057) +## 35.8.0 [#1057](https://github.com/openfisca/openfisca-core/pull/1057) #### Technical changes From 6de77798439e4615999464ed4afdf48f38d8a1af Mon Sep 17 00:00:00 2001 From: Matti Schneider Date: Fri, 29 Oct 2021 09:22:48 -0300 Subject: [PATCH 90/95] Remove obsolete CircleCI badge --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 7f253c9114..d1ef3da459 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ [![Twitter](https://img.shields.io/badge/twitter-follow%20us!-9cf.svg?style=flat)](https://twitter.com/intent/follow?screen_name=openfisca) [![Slack](https://img.shields.io/badge/slack-join%20us!-blueviolet.svg?style=flat)](mailto:contact%40openfisca.org?subject=Join%20you%20on%20Slack%20%7C%20Nous%20rejoindre%20sur%20Slack&body=%5BEnglish%20version%20below%5D%0A%0ABonjour%2C%0A%0AVotre%C2%A0pr%C3%A9sence%C2%A0ici%C2%A0nous%C2%A0ravit%C2%A0!%20%F0%9F%98%83%0A%0ARacontez-nous%20un%20peu%20de%20vous%2C%20et%20du%20pourquoi%20de%20votre%20int%C3%A9r%C3%AAt%20de%20rejoindre%20la%20communaut%C3%A9%20OpenFisca%20sur%20Slack.%0A%0AAh%C2%A0!%20Et%20si%20vous%20pouviez%20remplir%20ce%20petit%20questionnaire%2C%20%C3%A7a%20serait%20encore%20mieux%C2%A0!%0Ahttps%3A%2F%2Fgoo.gl%2Fforms%2F45M0VR1TYKD1RGzX2%0A%0AN%E2%80%99oubliez%20pas%20de%20nous%20envoyer%20cet%20email%C2%A0!%20Sinon%2C%20on%20ne%20pourra%20pas%20vous%20contacter%20ni%20vous%20inviter%20sur%20Slack.%0A%0AAmiti%C3%A9%2C%0AL%E2%80%99%C3%A9quipe%20OpenFisca%0A%0A%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%20ENGLISH%20VERSION%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0AHi%2C%20%0A%0AWe're%20glad%20to%20see%20you%20here!%20%F0%9F%98%83%0A%0APlease%20tell%20us%20a%20bit%20about%20you%20and%20why%20you%20want%20to%20join%20the%20OpenFisca%20community%20on%20Slack.%0A%0AAlso%2C%20if%20you%20can%20fill%20out%20this%20short%20survey%2C%20even%20better!%0Ahttps%3A%2F%2Fgoo.gl%2Fforms%2FsOg8K1abhhm441LG2.%0A%0ADon't%20forget%20to%20send%20us%20this%20email!%20Otherwise%20we%20won't%20be%20able%20to%20contact%20you%20back%2C%20nor%20invite%20you%20on%20Slack.%0A%0ACheers%2C%0AThe%20OpenFisca%20Team) -[![CircleCI](https://img.shields.io/circleci/project/github/openfisca/openfisca-core/master.svg?style=flat)](https://circleci.com/gh/openfisca/openfisca-core) [![Coveralls](https://img.shields.io/coveralls/github/openfisca/openfisca-core/master.svg?style=flat)](https://coveralls.io/github/openfisca/openfisca-core?branch=master) [![Python](https://img.shields.io/pypi/pyversions/openfisca-core.svg)](https://pypi.python.org/pypi/openfisca-core) [![PyPi](https://img.shields.io/pypi/v/openfisca-core.svg?style=flat)](https://pypi.python.org/pypi/openfisca-core) From 8453bffb981dee7d44ae893c588404c9a106ec77 Mon Sep 17 00:00:00 2001 From: Matti Schneider Date: Fri, 29 Oct 2021 09:22:56 -0300 Subject: [PATCH 91/95] Make CI mention vendor-neutral --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d1ef3da459..7f8b79c150 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,7 @@ rm -rf doc 7. Finally, open a pull request both in [core](https://github.com/openfisca/openfisca-core/compare/master...fix-doc) and in the [doc](https://github.com/openfisca/openfisca-doc/compare/master...fix-doc). -[CircleCI](.circleci/config.yml) will automatically try to build the documentation from the same branch in both core and the doc (in our example "fix-doc") so we can integrate first our changes to core, and then our changes to the doc. +Continuous integration will automatically try to build the documentation from the same branch in both core and the doc (in our example "fix-doc") so we can integrate first our changes to Core, and then our changes to the doc. If no changes were needed to the doc, then your changes to core will be verified against the production version of the doc. From ec1c3775be906fa1b90e7a5e50f6ddc5792a9c75 Mon Sep 17 00:00:00 2001 From: Hajar AIT EL KADI <48837850+HAEKADI@users.noreply.github.com> Date: Tue, 2 Nov 2021 08:43:28 +0100 Subject: [PATCH 92/95] Replace env variable with direct mention Co-authored-by: Matti Schneider --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index f2823a0640..10aff151d2 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -237,4 +237,4 @@ jobs: run: "${GITHUB_WORKSPACE}/.github/publish-git-tag.sh" - name: Update doc run: | - curl -X POST --header "Content-Type: application/json" -d '{"branch":"master"}' https://circleci.com/api/v1.1/project/github/openfisca/openfisca-doc/build?circle-token=$CIRCLE_TOKEN + curl -X POST --header "Content-Type: application/json" -d '{"branch":"master"}' https://circleci.com/api/v1.1/project/github/openfisca/openfisca-doc/build?circle-token=${{ secrets.CIRCLECI_V1_OPENFISCADOC_TOKEN }} From 9b67a3c8c0d1f1c17e5e5a7d0a92c0217e8b147a Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 2 Nov 2021 08:47:44 +0100 Subject: [PATCH 93/95] Bump patch version --- CHANGELOG.md | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fac165eb76..c0bed218ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 35.8.0 [#1057](https://github.com/openfisca/openfisca-core/pull/1057) +### 35.7.2 [#1057](https://github.com/openfisca/openfisca-core/pull/1057) #### Technical changes diff --git a/setup.py b/setup.py index 6b4ef20dcf..0575d56776 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ setup( name = 'OpenFisca-Core', - version = '35.8.0', + version = '35.7.2', author = 'OpenFisca Team', author_email = 'contact@openfisca.org', classifiers = [ From 01ab4df854abaeb6924d969973c81770cdb08482 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 2 Nov 2021 10:22:05 +0100 Subject: [PATCH 94/95] Delete patch bump --- CHANGELOG.md | 6 ------ setup.py | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0bed218ff..27d95ddaa3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,5 @@ # Changelog -### 35.7.2 [#1057](https://github.com/openfisca/openfisca-core/pull/1057) - -#### Technical changes - -- Switch CI provider from CircleCI to GitHub Actions - ### 35.7.1 [#1075](https://github.com/openfisca/openfisca-core/pull/1075) #### Bug fix diff --git a/setup.py b/setup.py index 0575d56776..36e30a751e 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ setup( name = 'OpenFisca-Core', - version = '35.7.2', + version = '35.7.1', author = 'OpenFisca Team', author_email = 'contact@openfisca.org', classifiers = [ From ff80338e4d202d189bc42e8e689397a2406b2032 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 2 Nov 2021 10:28:59 +0100 Subject: [PATCH 95/95] Bump patch version --- CHANGELOG.md | 6 ++++++ setup.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27d95ddaa3..c0bed218ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### 35.7.2 [#1057](https://github.com/openfisca/openfisca-core/pull/1057) + +#### Technical changes + +- Switch CI provider from CircleCI to GitHub Actions + ### 35.7.1 [#1075](https://github.com/openfisca/openfisca-core/pull/1075) #### Bug fix diff --git a/setup.py b/setup.py index 36e30a751e..0575d56776 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ setup( name = 'OpenFisca-Core', - version = '35.7.1', + version = '35.7.2', author = 'OpenFisca Team', author_email = 'contact@openfisca.org', classifiers = [