diff --git a/.github/workflows/compiler.yml b/.github/workflows/compiler.yml new file mode 100644 index 000000000..94682c50f --- /dev/null +++ b/.github/workflows/compiler.yml @@ -0,0 +1,79 @@ +name: Continuous integration - compiler + +on: + push: + branches: [ master ] + pull_request: + +env: + CARGO_TERM_COLOR: always + +jobs: + conditions: + runs-on: ubuntu-20.04 + outputs: + proceed: ${{ steps.interface-changes.outputs.any_changed == 'true' || github.ref == 'refs/heads/master' }} + steps: + - name: Code checkout + uses: actions/checkout@v3 + + - name: Detect changes on API to compiler + uses: tj-actions/changed-files@v19 + id: interface-changes + with: + files: | + concrete-optimizer-cpp/src/cpp/* + + - run: echo ${{ steps.interface-changes.outputs.any_changed }} + + check-compiler-compatibility: + runs-on: ubuntu-20.04 + needs: conditions + if: ${{ needs.conditions.outputs.proceed == 'true' }} + steps: + # A SSH private key is required as some dependencies are from private repos + - name: Set ssh keys + uses: webfactory/ssh-agent@v0.5.2 + with: + ssh-private-key: ${{ secrets.CONCRETE_COMPILER_CI_SSH_PRIVATE }} + + - name: Compiler checkout + uses: actions/checkout@v3 + with: + submodules: recursive + repository: zama-ai/concrete-compiler-internal + ssh-key: ${{ secrets.CONCRETE_COMPILER_CI_SSH_PRIVATE }} + + - name: Override optimizer for compiler + uses: actions/checkout@v3 + with: + path: compiler/.dependencies/concrete-optimizer + + - name: Install rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + - name: Download cargo cache + uses: Swatinem/rust-cache@v1 + + - name: Concrete-Optimizer + run: | + cd compiler + make concrete-optimizer-lib + + - name: Build compiler + uses: addnab/docker-run-action@v3 + with: + registry: ghcr.io + image: ghcr.io/zama-ai/concrete-compiler + username: zama-bot + password: ${{ secrets.ZAMA_BOT_TOKEN }} + options: >- + -v ${{ github.workspace }}/compiler:/compiler + shell: bash + run: | + set -e + cd /compiler + export PYTHONPATH="" + make CCACHE=ON BUILD_DIR=/build concretecompiler diff --git a/.github/workflows/rust.yml b/.github/workflows/optimizer.yml similarity index 87% rename from .github/workflows/rust.yml rename to .github/workflows/optimizer.yml index ff6ff7ece..17df59016 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/optimizer.yml @@ -8,13 +8,13 @@ on: env: CARGO_TERM_COLOR: always jobs: - all: + check-concrete-optimizer: runs-on: ubuntu-20.04 env: RUSTFLAGS: -D warnings steps: - name: Code checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Rust install uses: actions-rs/toolchain@v1 @@ -25,7 +25,8 @@ jobs: uses: Swatinem/rust-cache@v1 # A SSH private key is required as some dependencies are from private repos - - uses: webfactory/ssh-agent@v0.5.2 + - name: Set ssh keys + uses: webfactory/ssh-agent@v0.5.2 with: ssh-private-key: ${{ secrets.CONCRETE_COMPILER_CI_SSH_PRIVATE }}