Skip to content

Commit

Permalink
Remet le code en état d'origin est applique les modification pour l'a…
Browse files Browse the repository at this point in the history
…uthentification par token
  • Loading branch information
Allan-CodeWorks committed Jan 4, 2024
1 parent bc86648 commit f95b1ef
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 5 deletions.
68 changes: 64 additions & 4 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: OpenFisca France Local

on:
push:
branches:
- master
pull_request:

jobs:
Expand Down Expand Up @@ -40,7 +43,6 @@ jobs:
with:
path: dist
key: release-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}-${{ matrix.openfisca-dependencies }}

test-python:
runs-on: ubuntu-20.04
strategy:
Expand All @@ -66,15 +68,73 @@ jobs:
openfisca test tests/**/*.py
if: matrix.openfisca-dependencies != 'minimal'
test-yaml:
runs-on: ubuntu-20.04
strategy:
matrix:
openfisca-dependencies: [minimal, maximal]
needs: [ build ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9.9
- name: Cache build
id: restore-build
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}-${{ matrix.openfisca-dependencies }}
- name: Run YAML test
run: |
openfisca test tests --country-package openfisca_france --extensions openfisca_france_local
check-version-and-changelog:
runs-on: ubuntu-20.04
needs: [ test-yaml ] # Last job to run
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all the tags
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9.9
- 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-20.04
if: github.ref == 'refs/heads/master' # Only triggered for the `master` branch
needs: [ check-version-and-changelog ]
outputs:
status: ${{ steps.stop-early.outputs.status }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all the tags
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9.9
- id: stop-early
run: if "${GITHUB_WORKSPACE}/.github/has-functional-changes.sh" ; then echo "::set-output name=status::success" ; fi

deploy:
runs-on: ubuntu-20.04
strategy:
matrix:
openfisca-dependencies: [maximal]
needs: [ build ]
needs: [ check-for-functional-changes ]
if: needs.check-for-functional-changes.outputs.status == 'success'
env:
PYPI_USERNAME: __token__
PYPI_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN_API_ALLAN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -96,6 +156,6 @@ jobs:
path: dist
key: release-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}-${{ matrix.openfisca-dependencies }}
- name: Upload a Python package to PyPi
run: twine upload --repository testpypi dist/* --username $PYPI_USERNAME --password $PYPI_PASSWORD
run: twine upload dist/* --username $PYPI_USERNAME --password $PYPI_TOKEN
- name: Publish a git tag
run: "${GITHUB_WORKSPACE}/.github/publish-git-tag.sh"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


setup(
name='OpenFisca-France-Local_Allan',
name='OpenFisca-France-Local',
version='6.11.4',
author='OpenFisca Team',
author_email='[email protected]',
Expand Down

0 comments on commit f95b1ef

Please sign in to comment.