Skip to content

Commit

Permalink
Merge pull request #186 from openfisca/fix_tests
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
benoit-cty authored Jul 5, 2024
2 parents 92c7811 + 7f89e67 commit 5956e87
Show file tree
Hide file tree
Showing 13 changed files with 2,834 additions and 364 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: OpenFisca France Indirect Taxation

on:
push:
pull_request:
types: [opened, reopened]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-20.04"]
python-version: ["3.10.6"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache build
id: restore-build
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}-${{ matrix.os }}
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') }}-${{ matrix.os }}
build-${{ env.pythonLocation }}-${{ matrix.os }}
- name: Build package
run: make build
- name: Cache release
id: restore-release
uses: actions/cache@v3
with:
path: dist
key: release-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}-${{ matrix.os }}

lint-files:
runs-on: ubuntu-20.04
needs: [ build ]
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.10.6
- name: Cache build
id: restore-build
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}-ubuntu-20.04
- name: check-syntax-errors
run: make check-syntax-errors
- name: format-style
run: make format-style
- name: check-style
run: make check-style

test:
runs-on: ubuntu-20.04
needs: [ build ]
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.10.6
- name: Cache build
id: restore-build
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}-ubuntu-20.04
- name: Test carburants
run: openfisca test --country-package openfisca_france_indirect_taxation openfisca_france_indirect_taxation/tests/formulas/*carbu*
26 changes: 13 additions & 13 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@ Test_YAML_Carburants:
- openfisca test --country-package openfisca_france_indirect_taxation openfisca_france_indirect_taxation/tests/formulas/*carbu*


# Test_All:
# stage: test
# image: $CI_REGISTRY_IMAGE:latest
# tags:
# - data-in
# before_script:
# - mkdir -p ~/.config/openfisca-survey-manager
# - pip3 install -e .[dev]
# - cp ./runner/openfisca_survey_manager_raw_data.ini ~/.config/openfisca-survey-manager/raw_data.ini
# - cp /mnt/data-out/openfisca-france-indirect-taxation/openfisca_survey_manager_config_with_matched_data.ini ~/.config/openfisca-survey-manager/config.ini
# - mkdir -p /root/ci-files/data_collections
# script:
# - make test
Test_All:
stage: test
image: $CI_REGISTRY_IMAGE:latest
tags:
- data-in
before_script:
- mkdir -p ~/.config/openfisca-survey-manager
- pip3 install -e .[dev]
- cp ./runner/openfisca_survey_manager_raw_data.ini ~/.config/openfisca-survey-manager/raw_data.ini
- cp /mnt/data-out/openfisca-france-indirect-taxation/openfisca_survey_manager_config_with_matched_data.ini ~/.config/openfisca-survey-manager/config.ini
- mkdir -p /root/ci-files/data_collections
script:
- make test
1 change: 1 addition & 0 deletions openfisca_france_indirect_taxation/assets/prix/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pour mettre à jour les prix des carburants vous pouvez utiliser le dépôt https://git.leximpact.dev/leximpact/simulateur-socio-fiscal/openfisca/prix-carburants
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ Date,diesel_ht,diesel_ttc,gplc_ht,gplc_ttc,super_95_e10_ht,super_95_e10_ttc,supe
2019,,1.4433,,,,,,1.51,,1.56,,
2020,,1.2733,,,,,,1.37,,1.42,,
2021,,1.4433,,,,,,1.56,,1.62,,
2022,,1.86,,,,1.78,,1.83,,1.88,,
2023,,1.82,,,,1.88,,1.89,,1.95,,
2024,,1.78,,,,1.85,,1.89,,1.94,,
Loading

0 comments on commit 5956e87

Please sign in to comment.