Daily-Update #264
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Daily-Update | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# daily fetch and check | |
schedule: | |
- cron: '0 0 1/3 * *' | |
jobs: | |
configure-dependencies: | |
if: github.repository == 'aqjune/mlir-tv' | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Fetch dependency cache | |
id: cache | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/image/.dep | |
key: cache-dep-${{ secrets.CACHE_VERSION }} | |
# if cache miss | |
- name: Download dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
mkdir -p /tmp/image/.dep | |
sudo apt update -y | |
sudo apt install --download-only git g++ python3.9 python3.9-venv \ | |
cmake ninja-build default-jdk m4 libncurses5-dev | |
cp /var/cache/apt/archives/*.deb /tmp/image/.dep/ | |
# endif cache miss | |
configure-z3: | |
if: github.repository == 'aqjune/mlir-tv' | |
needs: configure-dependencies | |
runs-on: ubuntu-20.04 | |
outputs: | |
sha: ${{ steps.sha.outputs.sha }} | |
steps: | |
- name: Checkout Z3 | |
uses: actions/checkout@v2 | |
with: | |
repository: Z3Prover/z3 | |
ref: z3-4.8.13 | |
path: src/z3 | |
- name: Get Z3 SHA | |
id: sha | |
run: echo "::set-output name=sha::$(git -C src/z3 rev-parse HEAD)" | |
- name: Fetch Z3 cache | |
id: cache | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/image/opt/z3 | |
key: cache-z3-${{ secrets.CACHE_VERSION }}-${{ steps.sha.outputs.sha }} | |
# if cache miss | |
- name: Fetch dependency cache | |
if: steps.cache.outputs.cache-hit != 'true' | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/image/.dep | |
key: cache-dep-${{ secrets.CACHE_VERSION }} | |
- name: Unpack dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
sudo apt install /tmp/image/.dep/*.deb | |
- name: Rebuild Z3 | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
mkdir -p /tmp/image/opt/z3 | |
cd src/z3 | |
cmake -B build -G Ninja \ | |
-DCMAKE_INSTALL_PREFIX=/tmp/image/opt/z3 -DCMAKE_BUILD_TYPE=MinSizeRel | |
cmake --build build --target install | |
# endif cache miss | |
configure-cvc5: | |
if: github.repository == 'aqjune/mlir-tv' | |
needs: configure-dependencies | |
runs-on: ubuntu-20.04 | |
outputs: | |
sha: ${{ steps.sha.outputs.sha }} | |
steps: | |
- name: Checkout CVC5 | |
uses: actions/checkout@v2 | |
with: | |
repository: cvc5/cvc5 | |
ref: cvc5-1.2.0 | |
path: src/cvc5 | |
- name: Get CVC5 SHA | |
id: sha | |
run: echo "::set-output name=sha::$(git -C src/cvc5 rev-parse HEAD)" | |
- name: Fetch CVC5 cache | |
id: cache | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/image/opt/cvc5 | |
key: cache-cvc5-${{ secrets.CACHE_VERSION }}-${{ steps.sha.outputs.sha }} | |
# if cache miss | |
- name: Fetch dependency cache | |
if: steps.cache.outputs.cache-hit != 'true' | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/image/.dep | |
key: cache-dep-${{ secrets.CACHE_VERSION }} | |
- name: Unpack dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
sudo apt install /tmp/image/.dep/*.deb | |
- name: Rebuild CVC5 | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
sudo python3 -m pip install toml | |
mkdir -p /tmp/image/opt/cvc5 | |
cd src/cvc5 | |
./configure.sh --prefix=/tmp/image/opt/cvc5 --ninja --no-poly --auto-download | |
ninja -C build | |
ninja -C build install | |
# endif cache miss | |
configure-llvm: | |
if: github.repository == 'aqjune/mlir-tv' | |
needs: configure-dependencies | |
runs-on: ubuntu-20.04 | |
outputs: | |
sha: ${{ steps.sha.outputs.sha }} | |
steps: | |
- name: Checkout LLVM | |
uses: actions/checkout@v2 | |
with: | |
repository: llvm/llvm-project | |
path: src/llvm-project | |
- name: Get LLVM SHA | |
id: sha | |
run: echo "::set-output name=sha::$(git -C src/llvm-project rev-parse HEAD)" | |
- name: Fetch LLVM cache | |
id: cache | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/image/opt/llvm | |
key: cache-llvm-${{ secrets.CACHE_VERSION }}-${{ steps.sha.outputs.sha }} | |
# if cache miss | |
- name: Fetch dependency cache | |
if: steps.cache.outputs.cache-hit != 'true' | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/image/.dep | |
key: cache-dep-${{ secrets.CACHE_VERSION }} | |
- name: Unpack dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
sudo apt install /tmp/image/.dep/*.deb | |
- name: Rebuild LLVM | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
mkdir -p /tmp/image/opt/llvm | |
cd src/llvm-project | |
cmake -G Ninja -S llvm -B build \ | |
-DLLVM_ENABLE_PROJECTS="mlir" -DLLVM_TARGETS_TO_BUILD="X86" \ | |
-DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_ZLIB=Off -DLLVM_ENABLE_ZSTD=Off \ | |
-DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=/tmp/image/opt/llvm | |
cmake --build build --target install | |
# endif cache miss | |
build-image: | |
if: github.repository == 'aqjune/mlir-tv' | |
needs: [configure-z3, configure-cvc5, configure-llvm] | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Get date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | |
- name: Fetch Z3 cache | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/image/opt/z3 | |
key: cache-z3-${{ secrets.CACHE_VERSION }}-${{ needs.configure-z3.outputs.sha }} | |
- name: Fetch CVC5 cache | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/image/opt/cvc5 | |
key: cache-cvc5-${{ secrets.CACHE_VERSION }}-${{ needs.configure-cvc5.outputs.sha }} | |
- name: Fetch LLVM cache | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/image/opt/llvm | |
key: cache-llvm-${{ secrets.CACHE_VERSION }}-${{ needs.configure-llvm.outputs.sha }} | |
- name: Checkout this repo | |
uses: actions/checkout@v2 | |
with: | |
path: mlir-tv | |
- name: Move repo to absolute location | |
run: | | |
mv mlir-tv /tmp/image/mlir-tv | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build image | |
uses: docker/build-push-action@v2 | |
with: | |
context: /tmp/image | |
file: /tmp/image/mlir-tv/.github/workflows/env.Dockerfile | |
builder: ${{ steps.buildx.outputs.name }} | |
push: true | |
tags: | | |
strikef/mlir-tv-ci-base:latest | |
strikef/mlir-tv-ci-base:${{ steps.date.outputs.date }} |