# This job is the main jobs will dispatch build and test for every modules of our mono repo. name: Main on: pull_request: push: branches: - 'main' jobs: # This jobs outputs for each modules of our mono-repo if it changed, # in order to launch jobs only for the changed modules file-change: runs-on: ubuntu-latest permissions: pull-requests: write outputs: concrete-python: ${{ steps.concrete-python.outputs.any_changed }} compiler: ${{ steps.compiler.outputs.any_changed }} optimizer: ${{ steps.optimizer.outputs.any_changed }} concrete-cpu: ${{ steps.concrete-cpu.outputs.any_changed }} concrete-cuda: ${{ steps.concrete-cuda.outputs.any_changed }} push-main: ${{ steps.github.outputs.push-main }} steps: - name: Checkout the repository uses: actions/checkout@v3 with: fetch-depth: 0 token: ${{ secrets.CONCRETE_ACTIONS_TOKEN }} - name: Get changed files in the concrete-python directory id: concrete-python uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d with: files: frontends/concrete-python - name: Get changed files in the concrete-compiler directory id: compiler uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d with: files: compilers/concrete-compiler - name: Get changed files in the concrete-optimizer directory id: optimizer uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d with: files: compilers/concrete-optimizer - name: Get changed files in the concrete-cpu directory id: concrete-cpu uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d with: files: backends/concrete-cpu - name: Get changed files in the concrete-cuda directory id: concrete-cuda uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d with: files: backends/concrete-cuda - name: Set some github event outputs id: github if: github.event_name == 'push' && github.ref == 'refs/heads/main' run: echo "push-main=true" >> "$GITHUB_OUTPUT" ################################################# # concrete-python jobs ########################## concrete-python: needs: file-change if: needs.file-change.outputs.concrete-python == 'true' || needs.file-change.outputs.push-main uses: ./.github/workflows/concrete_python_build_and_test.yml secrets: inherit ################################################# # Compiler jobs ################################# compiler-compliance: needs: file-change if: needs.file-change.outputs.compiler == 'true' || needs.file-change.outputs.push-main == 'true' uses: ./.github/workflows/compiler_format_and_linting.yml compiler-cpu-build: needs: file-change if: needs.file-change.outputs.compiler == 'true' || needs.file-change.outputs.push-main == 'true' uses: ./.github/workflows/start_slab.yml secrets: inherit with: command: compiler-cpu-build compiler-gpu-build: needs: file-change if: needs.file-change.outputs.compiler == 'true' || needs.file-change.outputs.push-main == 'true' uses: ./.github/workflows/start_slab.yml secrets: inherit with: command: compiler-gpu-build compiler-macos-tests: needs: file-change if: needs.file-change.outputs.compiler == 'true' || needs.file-change.outputs.push-main == 'true' uses: ./.github/workflows/compiler_macos_build_and_test.yml secrets: inherit compiler-publish-docker-images: needs: file-change if: needs.file-change.outputs.compiler == 'true' && needs.file-change.outputs.push-main == 'true' uses: ./.github/workflows/start_slab.yml secrets: inherit with: command: compiler-publish-docker-images compiler-cpu-benchmark: needs: file-change if: needs.file-change.outputs.push-main == 'true' uses: ./.github/workflows/start_slab.yml secrets: inherit with: command: compiler-cpu-benchmark compiler-gpu-benchmark: needs: file-change if: needs.file-change.outputs.push-main == 'true' uses: ./.github/workflows/start_slab.yml secrets: inherit with: command: compiler-gpu-benchmark ################################################# # Optimizer jobs ################################ optimizer: needs: file-change if: needs.file-change.outputs.optimizer == 'true' || needs.file-change.outputs.push-main uses: ./.github/workflows/optimizer.yml secrets: inherit ################################################# # ConcreteCPU jobs ############################## concrete-cpu: needs: file-change if: needs.file-change.outputs.concrete-cpu == 'true' || needs.file-change.outputs.push-main uses: ./.github/workflows/concrete_cpu_test.yml secrets: inherit ################################################# # Concrete-cuda jobs ############################ concrete-cuda: needs: file-change if: needs.file-change.outputs.concrete-cuda == 'true' || needs.file-change.outputs.push-main uses: ./.github/workflows/concrete_cuda_test.yml secrets: inherit