diff --git a/.github/workflows/check_config_docs.yaml b/.github/workflows/check_config_docs.yaml index c1f130dc..1be2bfa6 100644 --- a/.github/workflows/check_config_docs.yaml +++ b/.github/workflows/check_config_docs.yaml @@ -18,6 +18,7 @@ name: Check if the config schema and the example are up to date on: push env: + PYTHON_VERSION: '3.9' IFRS_CONFIG_YAML: ./services/ifrs/dev_config.yaml IRS_CONFIG_YAML: ./services/irs/dev_config.yaml PCS_CONFIG_YAML: ./services/pcs/dev_config.yaml @@ -40,13 +41,21 @@ jobs: fail-fast: false steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + - name: Restore cache id: restore-cache uses: actions/cache@v4 with: - path: ${{ needs.build-cache.outputs.python-location }} + path: | + ${{ github.repository }} + ${{ env.pythonLocation }} key: ${{ github.sha }} + - name: Check config docs id: check-config-docs run: | diff --git a/.github/workflows/check_openapi_specs.yaml b/.github/workflows/check_openapi_specs.yaml index b8734ea9..fe12143b 100644 --- a/.github/workflows/check_openapi_specs.yaml +++ b/.github/workflows/check_openapi_specs.yaml @@ -18,6 +18,7 @@ name: Check if OpenAPI spec is up to date on: push env: + PYTHON_VERSION: '3.9' IFRS_CONFIG_YAML: ./services/ifrs/dev_config.yaml IRS_CONFIG_YAML: ./services/irs/dev_config.yaml PCS_CONFIG_YAML: ./services/pcs/dev_config.yaml @@ -40,11 +41,18 @@ jobs: fail-fast: false steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + - name: Restore cache id: restore-cache uses: actions/cache@v4 with: - path: ${{ needs.build-cache.outputs.python-location }} + path: | + ${{ github.repository }} + ${{ env.pythonLocation }} key: ${{ github.sha }} - name: Check openapi.yaml diff --git a/.github/workflows/check_pyproject.yaml b/.github/workflows/check_pyproject.yaml index 46497eed..37dc65dd 100644 --- a/.github/workflows/check_pyproject.yaml +++ b/.github/workflows/check_pyproject.yaml @@ -17,6 +17,9 @@ name: Check if pyproject.toml file is up to date on: push +env: + PYTHON_VERSION: '3.9' + jobs: build-cache: uses: ./.github/workflows/prepare_build_cache.yaml @@ -29,11 +32,18 @@ jobs: runs-on: ubuntu-latest steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + - name: Restore cache id: restore-cache uses: actions/cache@v4 with: - path: ${{ needs.build-cache.outputs.python-location }} + path: | + ${{ github.repository }} + ${{ env.pythonLocation }} key: ${{ github.sha }} - name: Check pyproject.toml diff --git a/.github/workflows/check_readmes.yaml b/.github/workflows/check_readmes.yaml index 966d33df..f5e9bd76 100644 --- a/.github/workflows/check_readmes.yaml +++ b/.github/workflows/check_readmes.yaml @@ -18,6 +18,7 @@ name: Check if the README files are up to date on: push env: + PYTHON_VERSION: '3.9' IFRS_CONFIG_YAML: ./services/ifrs/dev_config.yaml IRS_CONFIG_YAML: ./services/irs/dev_config.yaml PCS_CONFIG_YAML: ./services/pcs/dev_config.yaml @@ -33,13 +34,21 @@ jobs: runs-on: ubuntu-latest steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + - name: Restore cache id: restore-cache uses: actions/cache@v4 with: - path: ${{ needs.build-cache.outputs.python-location }} + path: | + ${{ github.repository }} + ${{ env.pythonLocation }} key: ${{ github.sha }} + - name: Check top level README id: check-main-readme run: | @@ -56,13 +65,21 @@ jobs: fail-fast: false steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + - name: Restore cache id: restore-cache uses: actions/cache@v4 with: - path: ${{ needs.build-cache.outputs.python-location }} + path: | + ${{ github.repository }} + ${{ env.pythonLocation }} key: ${{ github.sha }} + - name: Check service level READMEs id: check-service-readmes run: | diff --git a/.github/workflows/prepare_build_cache.yaml b/.github/workflows/prepare_build_cache.yaml index e4f7020f..4ed803dd 100644 --- a/.github/workflows/prepare_build_cache.yaml +++ b/.github/workflows/prepare_build_cache.yaml @@ -2,6 +2,7 @@ name: Get services affected by changes concurrency: group: ${{ github.sha }}-build-cache + cancel-in-progress: false on: workflow_call: @@ -37,21 +38,21 @@ jobs: with: fetch-depth: 2 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.python-version }} + - name: Restore cache id: restore-cache uses: actions/cache/restore@v4 with: path: | - ${{ env.pythonLocation }} + ${{ env.python-location }} + ${{ github.repository }} services.txt key: ${{ inputs.cache-key }} - - name: Set up Python - if: steps.restore-cache.outputs.cache-hit != 'true' - uses: actions/setup-python@v5 - with: - python-version: ${{ inputs.python-version }} - - name: Update pip, pyopenssl and install dependencies id: pip-update if: steps.restore-cache.outputs.cache-hit != 'true' @@ -94,11 +95,12 @@ jobs: with: path: | ${{ env.pythonLocation }} + ${{ github.repository }} services.txt key: ${{ inputs.cache-key }} - name: Set output id: set-output run: | - echo "python-location=${{env.pythonLocation}}" >> $GITHUB_OUTPUT echo "services=${{toJson(env.services)}}" >> $GITHUB_OUTPUT + echo "python-location=$(dirname $(dirname $(which python)))" >> $GITHUB_OUTPUT diff --git a/.github/workflows/static_code_analysis.yaml b/.github/workflows/static_code_analysis.yaml index eff0d693..0b6ada64 100644 --- a/.github/workflows/static_code_analysis.yaml +++ b/.github/workflows/static_code_analysis.yaml @@ -17,6 +17,9 @@ name: Static Code Analysis on: push +env: + PYTHON_VERSION: '3.9' + jobs: build-cache: uses: ./.github/workflows/prepare_build_cache.yaml @@ -29,13 +32,21 @@ jobs: runs-on: ubuntu-latest steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + - name: Restore cache id: restore-cache uses: actions/cache@v4 with: - path: ${{ needs.build-cache.outputs.python-location }} + path: | + ${{ github.repository }} + ${{ env.pythonLocation }} key: ${{ github.sha }} + - name: Run pre-commit uses: pre-commit/action@v3.0.1 env: diff --git a/.github/workflows/tests_on_pr.yaml b/.github/workflows/tests_on_pr.yaml index 059d279c..9118e656 100644 --- a/.github/workflows/tests_on_pr.yaml +++ b/.github/workflows/tests_on_pr.yaml @@ -20,6 +20,7 @@ on: types: [opened, reopened] env: + PYTHON_VERSION: '3.9' IFRS_CONFIG_YAML: ./services/ifrs/dev_config.yaml IRS_CONFIG_YAML: ./services/irs/dev_config.yaml PCS_CONFIG_YAML: ./services/pcs/dev_config.yaml @@ -40,11 +41,18 @@ jobs: fail-fast: false steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + - name: Restore cache id: restore-cache uses: actions/cache@v4 with: - path: ${{ needs.build-cache.outputs.python-location }} + path: | + ${{ github.repository }} + ${{ env.pythonLocation }} key: ${{ github.sha }} - name: Run tests for ${{matrix.service}} diff --git a/.github/workflows/tests_on_push.yaml b/.github/workflows/tests_on_push.yaml index d4ab9f57..d3743ac2 100644 --- a/.github/workflows/tests_on_push.yaml +++ b/.github/workflows/tests_on_push.yaml @@ -21,6 +21,7 @@ on: - main env: + PYTHON_VERSION: '3.9' IFRS_CONFIG_YAML: ./services/ifrs/dev_config.yaml IRS_CONFIG_YAML: ./services/irs/dev_config.yaml PCS_CONFIG_YAML: ./services/pcs/dev_config.yaml @@ -41,11 +42,18 @@ jobs: fail-fast: false steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + - name: Restore cache id: restore-cache uses: actions/cache@v4 with: - path: ${{ needs.build-cache.outputs.python-location }} + path: | + ${{ github.repository }} + ${{ env.pythonLocation }} key: ${{ github.sha }} - name: Run tests for ${{matrix.service}}