Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin LLVM versions in github actions #619

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions .github/ci.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -Eeuxo pipefail

DATE=`date "+%Y-%m-%d"`
DATE=$(date "+%Y-%m-%d")
[[ "$RUNNER_OS" == 'Windows' ]] && IS_WIN=true || IS_WIN=false
BIN=bin
EXT=""
Expand Down Expand Up @@ -112,29 +112,13 @@ build() {
}

test() {
# System-agnostic path
export PATH="$PATH:/usr/local/opt/llvm/bin:/c/Program Files/LLVM/bin"
cabal v2-test "$@"
}

install_llvm() {
if [[ "$RUNNER_OS" = "Linux" ]]; then
sudo apt-get update -q && sudo apt-get install -y clang-10 llvm-10-tools
elif [[ "$RUNNER_OS" = "macOS" ]]; then
brew install llvm@10
elif [[ "$RUNNER_OS" = "Windows" ]]; then
choco install llvm
else
echo "Unknown platform!"
return 1
fi
}

install_system_deps() {
install_z3 &
# install_cvc4 &
install_yices &
install_llvm &
wait
export PATH=$PWD/$BIN:$PATH
echo "$PWD/$BIN" >> $GITHUB_PATH
Expand Down Expand Up @@ -166,7 +150,7 @@ zip_dist() {
bundle_crux_llvm_files() {
setup_dist
extract_exe crux-llvm dist/bin
if ! $IS_WIN ; then
if ! $IS_WIN; then
extract_exe crux-llvm-svcomp dist/bin
fi
cp crux-llvm/README.md dist/doc
Expand Down
53 changes: 17 additions & 36 deletions .github/workflows/crux-llvm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,8 @@ on:
workflow_dispatch:

jobs:
outputs:
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.outputs.outputs.changed-files }}
name: ${{ steps.outputs.outputs.name }}
crux-llvm-version: ${{ steps.outputs.outputs.crux-llvm-version }}
release: ${{ steps.env.outputs.release }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- id: outputs
run: |
.github/ci.sh set_crux_llvm_version

build:
runs-on: ${{ matrix.os }}
needs: [outputs]
strategy:
fail-fast: false
matrix:
Expand All @@ -42,6 +26,16 @@ jobs:
with:
submodules: true

- name: Set version
run: .github/ci.sh set_crux_llvm_version
id: version

- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "10"
directory: ${{ runner.temp }}/llvm

- uses: actions/setup-haskell@v1
id: setup-haskell
with:
Expand Down Expand Up @@ -70,28 +64,15 @@ jobs:
run: .github/ci.sh build exe:crux-llvm

- shell: bash
name: Test (Linux)
name: Test
run: .github/ci.sh test crux-llvm
if: runner.os == 'Linux'
env:
LLVM_LINK: "llvm-link-10"
CLANG: "clang-10"
LLVM_LINK: ${{ runner.temp }}/llvm/bin/llvm-link
LIBCLANG_PATH: ${{ runner.temp }}/llvm/lib
CLANG: ${{ runner.temp }}/llvm/bin/clang

- shell: bash
name: Test (macOS)
run: .github/ci.sh test crux-llvm
if: runner.os == 'macOS'
env:
LLVM_LINK: "/usr/local/opt/llvm/bin/llvm-link"
CLANG: "/usr/local/opt/llvm/bin/clang"

- shell: bash
name: Test (Windows)
run: .github/ci.sh test crux-llvm
if: runner.os == 'Windows'
env:
LLVM_LINK: "/c/Program Files/LLVM/bin/llvm-link"
CLANG: "/c/Program Files/LLVM/bin/clang"
- uses: mxschmitt/action-tmate@v3
if: runner.os == 'macOS' && matrix.ghc == '8.6.5'

- shell: bash
run: .github/ci.sh build exe:crux-llvm-svcomp
Expand All @@ -102,7 +83,7 @@ jobs:
env:
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
VERSION: ${{ needs.outputs.outputs.crux-llvm-version }}
VERSION: ${{ steps.version.outputs.crux-llvm-version }}

- uses: actions/upload-artifact@v2
with:
Expand Down
32 changes: 13 additions & 19 deletions .github/workflows/crux-mir-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,8 @@ on:
workflow_dispatch:

jobs:
outputs:
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.outputs.outputs.changed-files }}
name: ${{ steps.outputs.outputs.name }}
crux-mir-version: ${{ steps.outputs.outputs.crux-mir-version }}
release: ${{ steps.env.outputs.release }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- id: outputs
run: |
.github/ci.sh set_crux_mir_version

build:
runs-on: ${{ matrix.os }}
needs: [outputs]
strategy:
fail-fast: false
matrix:
Expand All @@ -44,6 +28,10 @@ jobs:
with:
submodules: true

- name: Set version
run: .github/ci.sh set_crux_mir_version
id: version

- uses: actions/setup-haskell@v1
id: setup-haskell
with:
Expand Down Expand Up @@ -72,8 +60,13 @@ jobs:
Z3_VERSION: "4.8.8"
YICES_VERSION: "2.6.2"

- uses: Swatinem/rust-cache@v1
with:
working-directory: dependencies/mir-json

- shell: bash
run: cd dependencies/mir-json && cargo install --locked --force
run: cargo install --locked --force --path .
working-directory: dependencies/mir-json

- shell: bash
run: .github/ci.sh configure
Expand All @@ -82,7 +75,8 @@ jobs:
run: .github/ci.sh build exe:crux-mir

- shell: bash
run: cd crux-mir && bash ./translate_libs.sh
run: ./translate_libs.sh
working-directory: crux-mir

- shell: bash
run: .github/ci.sh test crux-mir
Expand All @@ -92,7 +86,7 @@ jobs:
env:
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
VERSION: ${{ needs.outputs.outputs.crux-mir-version }}
VERSION: ${{ steps.version.outputs.crux-mir-version }}

- uses: actions/upload-artifact@v2
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ cabal.project.local
*.tix
.ghc.environment.*
*~
cabal.project.freeze