diff --git a/.github/workflows/aws_tfhe_tests.yml b/.github/workflows/aws_tfhe_tests.yml index 353f396561..39039617d0 100644 --- a/.github/workflows/aws_tfhe_tests.yml +++ b/.github/workflows/aws_tfhe_tests.yml @@ -21,7 +21,7 @@ on: jobs: file-change: - if: ${{ github.event_name == 'pull_request' }} # FIXME tester le cas où on est en schedule pour le `needs.` + if: ${{ github.event_name == 'pull_request' }} runs-on: ubuntu-latest permissions: pull-requests: write @@ -36,7 +36,7 @@ jobs: csprng_test: ${{ steps.changed-files.outputs.csprng_any_changed }} apps_test: ${{ steps.changed-files.outputs.apps_any_changed }} user_docs_test: ${{ steps.changed-files.outputs.user_docs_any_changed }} - any_file_changed: ${{ steps.changed-files.outputs.any_changed }} + any_file_changed: ${{ steps.aggregated-changes.outputs.any_changed }} steps: - name: Checkout tfhe-rs uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b @@ -71,12 +71,25 @@ jobs: - tfhe/docs/** - README.md - # TODO Ajouter une étape qui aggrège tous les résultats de "any_changed" en utilisant un any() + - name: Aggregate file changes + id: aggregated-changes + if: ( steps.changed-files.outputs.core_crypto_any_changed == 'true' || + steps.changed-files.outputs.boolean_any_changed == 'true' || + steps.changed-files.outputs.shortint_any_changed == 'true' || + steps.changed-files.outputs.c_api_any_changed == 'true' || + steps.changed-files.outputs.high_level_api_any_changed == 'true' || + steps.changed-files.outputs.examples_any_changed == 'true' || + steps.changed-files.outputs.zk_pok_any_changed == 'true' || + steps.changed-files.outputs.csprng_any_changed == 'true' || + steps.changed-files.outputs.apps_any_changed == 'true' || + steps.changed-files.outputs.user_docs_any_changed == 'true') + run: | + echo "any_changed=true" >> "$GITHUB_OUTPUT" setup-instance: name: Setup instance (cpu-tests) - #if: ${{ github.event_name == 'pull_request' && needs.file-change.outputs.any_file_changed == 'true' }} - ###############if: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.label.name, 'approved') }} + if: ( (always() && github.event_name != 'pull_request') || + (github.event_name == 'pull_request' && needs.file-change.outputs.any_file_changed == 'true') ) needs: file-change runs-on: ubuntu-latest outputs: @@ -95,7 +108,9 @@ jobs: cpu-tests: name: CPU tests - needs: setup-instance + if: ((always() && github.event_name != 'pull_request') || + (github.event_name == 'pull_request' && needs.setup-instance.outputs.runner-name != '')) + needs: [ file-change, setup-instance ] concurrency: group: ${{ github.workflow }}_${{ github.ref }} cancel-in-progress: true @@ -114,60 +129,70 @@ jobs: toolchain: stable - name: Run concrete-csprng tests - if: needs.file-change.outputs.csprng_test == 'true' + if: needs.file-change.outputs.csprng_test == 'true' || + needs.file-change.result == 'skipped' run: | make test_concrete_csprng - name: Run tfhe-zk-pok tests - if: needs.file-change.outputs.zk_pok_test == 'true' + if: needs.file-change.outputs.zk_pok_test == 'true' || + needs.file-change.result == 'skipped' run: | make test_zk_pok - name: Run core tests - if: needs.file-change.outputs.core_crypto_test == 'true' + if: needs.file-change.outputs.core_crypto_test == 'true' || + needs.file-change.result == 'skipped' run: | AVX512_SUPPORT=ON make test_core_crypto - name: Run boolean tests - if: needs.file-change.outputs.boolean_test == 'true' + if: needs.file-change.outputs.boolean_test == 'true' || + needs.file-change.result == 'skipped' run: | make test_boolean - name: Run C API tests - if: needs.file-change.outputs.c_api_test == 'true' + if: needs.file-change.outputs.c_api_test == 'true' || + needs.file-change.result == 'skipped' run: | make test_c_api - name: Run user docs tests - if: needs.file-change.outputs.user_docs_test == 'true' + if: needs.file-change.outputs.user_docs_test == 'true' || + needs.file-change.result == 'skipped' run: | make test_user_doc - name: Gen Keys if required if: (needs.file-change.outputs.core_crypto_test == 'true' || - needs.file-change.outputs.shortint_test == 'true') + needs.file-change.outputs.shortint_test == 'true') || + needs.file-change.result == 'skipped' run: | make gen_key_cache - name: Run shortint tests if: (needs.file-change.outputs.core_crypto_test == 'true' || - needs.file-change.outputs.shortint_test == 'true') + needs.file-change.outputs.shortint_test == 'true') || + needs.file-change.result == 'skipped' run: | BIG_TESTS_INSTANCE=TRUE make test_shortint_ci - name: Run high-level API tests - if: needs.file-change.outputs.high_level_api_test == 'true' + if: needs.file-change.outputs.high_level_api_test == 'true' || needs.file-change.result == 'skipped' run: | BIG_TESTS_INSTANCE=TRUE make test_high_level_api - name: Run example tests - if: needs.file-change.outputs.examples_test == 'true' + if: needs.file-change.outputs.examples_test == 'true' || + needs.file-change.result == 'skipped' run: | make test_examples make dark_market - name: Run apps tests - if: needs.file-change.outputs.apps_test == 'true' + if: needs.file-change.outputs.apps_test == 'true' || + needs.file-change.result == 'skipped' run: | make test_trivium make test_kreyvium