ci: new unified build system

This commit is contained in:
youben11
2021-10-05 16:23:19 +01:00
committed by Ayoub Benaissa
parent 2972fa4403
commit bfc763144c
10 changed files with 57 additions and 69 deletions

View File

@@ -17,25 +17,23 @@ jobs:
run: .github/workflows/scripts/format_cpp.sh
BuildAndTest:
runs-on: ubuntu-latest
env:
LLVM_PROJECT: $GITHUB_WORKSPACE/llvm_project
steps:
- uses: actions/checkout@v2
- name: Get the concrete CAPI release
uses: addnab/docker-run-action@v3
with:
registry: ghcr.io
image: ghcr.io/zama-ai/concrete-api-env:latest
username: ${{ secrets.GHCR_LOGIN }}
password: ${{ secrets.GHCR_PASSWORD }}
options: -v ${{ github.workspace }}:/workspace
run: mkdir -p /workspace/concrete/target && cp -r /target/release /workspace/concrete/target
submodules: recursive
- name: Log LLVM commit
run: echo "LLVM commit" && cd ${{ github.workspace }}/llvm-project && git log -1
- name: Build and test compiler
uses: addnab/docker-run-action@v3
with:
registry: ghcr.io
image: ghcr.io/zama-ai/mlir@sha256:5b7adfbf4e28c5a7517ed0b2bb0347455dea86f495b3ba060f6bea70c9dc10d3
image: ghcr.io/zama-ai/zamalang-compiler:latest
username: ${{ secrets.GHCR_LOGIN }}
password: ${{ secrets.GHCR_PASSWORD }}
options: -v ${{ github.workspace }}:/workspace -e PYTHONPATH=/llvm-project/build/python:/workspace/compiler/build/python -e LD_LIBRARY_PATH=/workspace/compiler/build/lib/Runtime/
run: cd /workspace/compiler && mkdir build && cmake -B build . -DCONCRETE_FFI_RELEASE=/workspace/concrete/target/release -DLLVM_DIR=$LLVM_PROJECT/build/lib/cmake/llvm -DMLIR_DIR=$LLVM_PROJECT/build/lib/cmake/mlir && make -C build/ all zamacompiler && make test && pip install pytest && LD_PRELOAD=./build/lib/Runtime/libZamalangRuntime.so make test_python
options: -v ${{ github.workspace }}/compiler:/compiler
run: |
cd /compiler
pip install pytest
make BUILD_DIR=/build test

View File

@@ -1,29 +0,0 @@
name: Docker image (MLIR)
on:
push:
paths:
- builders/Dockerfile.mlir-env
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build_publish:
name: Build & Publish the Docker image
runs-on: ubuntu-latest
env:
IMAGE: ghcr.io/zama-ai/mlir
steps:
- uses: actions/checkout@v2
- name: build
run: docker build -t $IMAGE -f builders/Dockerfile.mlir-env .
- name: login
run: echo "${{ secrets.GHCR_PASSWORD }}" | docker login -u ${{ secrets.GHCR_LOGIN }} --password-stdin ghcr.io
- name: tag and publish
run: |
docker push $IMAGE:latest

View File

@@ -1,4 +1,4 @@
name: Docker image (ZamaLang)
name: Docker image
on:
push:
@@ -19,21 +19,23 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: login
run: echo "${{ secrets.GHCR_PASSWORD }}" | docker login -u ${{ secrets.GHCR_LOGIN }} --password-stdin ghcr.io
- name: build
run: docker build -t $IMAGE -f builders/Dockerfile.zamalang-env .
run: docker image build --no-cache --label "commit-sha=${{ github.sha }}" -t $IMAGE -f builders/Dockerfile.zamalang-env .
- name: tag and publish
run: |
docker tag $IMAGE $IMAGE:${{ github.sha }}
docker push $IMAGE:latest
docker push $IMAGE:${{ github.sha }}
docker image tag $IMAGE $IMAGE:${{ github.sha }}
docker image push $IMAGE:latest
docker image push $IMAGE:${{ github.sha }}
- name: tag and publish release image
if: github.event_name == 'release'
run: |
docker tag $IMAGE $IMAGE:${{ github.event.release.tag_name }}
docker push $IMAGE:${{ github.event.release.tag_name }}
docker image tag $IMAGE $IMAGE:${{ github.event.release.tag_name }}
docker image push $IMAGE:${{ github.event.release.tag_name }}