Files
concrete/.github/workflows/main.yml
2023-03-20 13:02:22 +01:00

158 lines
5.5 KiB
YAML

# 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:
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 }}
concrete-python: ${{ steps.concrete-python.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-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: Get changed files in the concrete-python directory
id: concrete-python
uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d
with:
files: frontends/concrete-python
- 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"
#################################################
# 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
#################################################
# 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_checks.yml
secrets: inherit
concrete-python-tests:
needs: file-change
if: needs.file-change.outputs.concrete-python == 'true' && needs.file-change.outputs.compiler == 'false' && !needs.file-change.outputs.push-main
uses: ./.github/workflows/start_slab.yml
secrets: inherit
with:
command: concrete-python-tests