Skip to content

Commit

Permalink
WIP: simple change to test ifs refacto
Browse files Browse the repository at this point in the history
  • Loading branch information
soonum committed May 16, 2024
1 parent b6b130b commit d4030ae
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 44 deletions.
75 changes: 32 additions & 43 deletions .github/workflows/aws_tfhe_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,22 @@ on:
- cron: "0 1 * * MON-FRI"

jobs:
file-change:
# if: ${{ github.event_name == 'pull_request' }}
should-run:
runs-on: ubuntu-latest
permissions:
pull-requests: write
outputs:
core_crypto_test: ${{ !env.IS_PULL_REQUEST || steps.changed-files.outputs.core_crypto_any_changed }}
boolean_test: ${{ !env.IS_PULL_REQUEST || steps.changed-files.outputs.boolean_any_changed }}
shortint_test: ${{ steps.changed-files.outputs.shortint_any_changed }}
c_api_test: ${{ steps.changed-files.outputs.c_api_any_changed }}
high_level_api_test: ${{ steps.changed-files.outputs.high_level_api_any_changed }}
examples_test: ${{ steps.changed-files.outputs.examples_any_changed }}
zk_pok_test: ${{ steps.changed-files.outputs.zk_pok_any_changed }}
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.aggregated-changes.outputs.any_changed }}
core_crypto_test: ${{ env.IS_PULL_REQUEST == 'false' || steps.changed-files.outputs.core_crypto_any_changed }}
boolean_test: ${{ env.IS_PULL_REQUEST == 'false' || steps.changed-files.outputs.boolean_any_changed }}
shortint_test: ${{ env.IS_PULL_REQUEST == 'false' || steps.changed-files.outputs.shortint_any_changed }}
c_api_test: ${{ env.IS_PULL_REQUEST == 'false' || steps.changed-files.outputs.c_api_any_changed }}
high_level_api_test: ${{ env.IS_PULL_REQUEST == 'false' || steps.changed-files.outputs.high_level_api_any_changed }}
examples_test: ${{ env.IS_PULL_REQUEST == 'false' || steps.changed-files.outputs.examples_any_changed }}
zk_pok_test: ${{ env.IS_PULL_REQUEST == 'false' || steps.changed-files.outputs.zk_pok_any_changed }}
csprng_test: ${{ env.IS_PULL_REQUEST == 'false' || steps.changed-files.outputs.csprng_any_changed }}
apps_test: ${{ env.IS_PULL_REQUEST == 'false' || steps.changed-files.outputs.apps_any_changed }}
user_docs_test: ${{ env.IS_PULL_REQUEST == 'false' || steps.changed-files.outputs.user_docs_any_changed }}
any_file_changed: ${{ env.IS_PULL_REQUEST == 'false' || steps.aggregated-changes.outputs.any_changed }}
steps:
- name: Checkout tfhe-rs
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
Expand Down Expand Up @@ -89,9 +88,9 @@ jobs:
setup-instance:
name: Setup instance (cpu-tests)
if: ( (always() && github.event_name != 'pull_request') ||
(github.event_name == 'pull_request' && needs.file-change.outputs.any_file_changed == 'true') )
needs: file-change
if: (always() && github.event_name != 'pull_request') ||
(github.event_name == 'pull_request' && needs.should-run.outputs.any_file_changed == 'true')
needs: should-run
runs-on: ubuntu-latest
outputs:
runner-name: ${{ steps.start-instance.outputs.label }}
Expand All @@ -109,11 +108,11 @@ jobs:

cpu-tests:
name: CPU tests
if: ((always() && github.event_name != 'pull_request') ||
(github.event_name == 'pull_request' && needs.setup-instance.result != 'skipped'))
needs: [ file-change, setup-instance ]
if: (!cancelled() && github.event_name != 'pull_request') ||
(github.event_name == 'pull_request' && needs.setup-instance.result != 'skipped')
needs: [ should-run, setup-instance ]
concurrency:
group: ${{ github.workflow }}_${{ github.ref }}
group: ${{ github.workflow }}_${{github.event_name}}_${{ github.ref }}
cancel-in-progress: true
runs-on: ${{ needs.setup-instance.outputs.runner-name }}
steps:
Expand All @@ -130,70 +129,60 @@ jobs:
toolchain: stable

- name: Run concrete-csprng tests
if: needs.file-change.outputs.csprng_test == 'true' ||
needs.file-change.result == 'skipped'
if: needs.should-run.outputs.csprng_test == 'true'
run: |
make test_concrete_csprng
- name: Run tfhe-zk-pok tests
if: needs.file-change.outputs.zk_pok_test == 'true' ||
needs.file-change.result == 'skipped'
if: needs.should-run.outputs.zk_pok_test == 'true'
run: |
make test_zk_pok
- name: Run core tests
if: needs.file-change.outputs.core_crypto_test == 'true' ||
needs.file-change.result == 'skipped'
if: needs.should-run.outputs.core_crypto_test == 'true'
run: |
AVX512_SUPPORT=ON make test_core_crypto
- name: Run boolean tests
if: needs.file-change.outputs.boolean_test == 'true' ||
needs.file-change.result == 'skipped'
if: needs.should-run.outputs.boolean_test == 'true'
run: |
make test_boolean
- name: Run C API tests
if: needs.file-change.outputs.c_api_test == 'true' ||
needs.file-change.result == 'skipped'
if: needs.should-run.outputs.c_api_test == 'true'
run: |
make test_c_api
- name: Run user docs tests
if: needs.file-change.outputs.user_docs_test == 'true' ||
needs.file-change.result == 'skipped'
if: needs.should-run.outputs.user_docs_test == 'true'
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.result == 'skipped'
if: (needs.should-run.outputs.core_crypto_test == 'true' ||
needs.should-run.outputs.shortint_test == 'true')
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.result == 'skipped'
if: (needs.should-run.outputs.core_crypto_test == 'true' ||
needs.should-run.outputs.shortint_test == 'true')
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' || needs.file-change.result == 'skipped'
if: needs.should-run.outputs.high_level_api_test == 'true'
run: |
BIG_TESTS_INSTANCE=TRUE make test_high_level_api
- name: Run example tests
if: needs.file-change.outputs.examples_test == 'true' ||
needs.file-change.result == 'skipped'
if: needs.should-run.outputs.examples_test == 'true'
run: |
make test_examples
make dark_market
- name: Run apps tests
if: needs.file-change.outputs.apps_test == 'true' ||
needs.file-change.result == 'skipped'
if: needs.should-run.outputs.apps_test == 'true'
run: |
make test_trivium
make test_kreyvium
Expand Down
3 changes: 2 additions & 1 deletion tfhe/src/boolean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ pub(crate) fn random_integer() -> u32 {
// generate a random u32
rng.gen::<u32>()
}

// Simple change to test triggering
// Second changes
/// Generate a couple of client and server keys with the default cryptographic parameters:
/// `DEFAULT_PARAMETERS`.
/// The client is the one generating both keys.
Expand Down

0 comments on commit d4030ae

Please sign in to comment.