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

CI: Build and test both x86-64 and AArch64 macOS #1173

Merged
merged 5 commits into from
Feb 15, 2024
Merged
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
5 changes: 4 additions & 1 deletion .github/Dockerfile-crux-llvm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

WORKDIR /usr/local/bin
RUN curl -o solvers.zip -sL "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20220902/ubuntu-22.04-bin.zip"
# The URL here is based on the same logic used to specify BUILD_TARGET_OS and
# BUILD_TARGET_ARCH in `.github/workflow/crux-llvm-build.yml`, but specialized
# to x86-64 Ubuntu.
RUN curl -o solvers.zip -sL "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20240212/ubuntu-22.04-X64-bin.zip"
RUN unzip solvers.zip && rm solvers.zip && chmod +x *

ENV PATH=/root/ghcup-download/bin:/root/.ghcup/bin:$PATH
Expand Down
5 changes: 4 additions & 1 deletion .github/Dockerfile-crux-mir
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ RUN apt-get update && \
COPY --from=mir_json /usr/local/cargo /usr/local/cargo
COPY --from=mir_json /usr/local/rustup /usr/local/rustup
WORKDIR /usr/local/bin
RUN curl -o solvers.zip -sL "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20220902/ubuntu-22.04-bin.zip"
# The URL here is based on the same logic used to specify BUILD_TARGET_OS and
# BUILD_TARGET_ARCH in `.github/workflow/crux-mir-build.yml`, but specialized
# to x86-64 Ubuntu.
RUN curl -o solvers.zip -sL "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20240212/ubuntu-22.04-X64-bin.zip"
RUN unzip solvers.zip && rm solvers.zip && chmod +x *

ENV CARGO_HOME=/usr/local/cargo
Expand Down
4 changes: 2 additions & 2 deletions .github/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ install_llvm() {
}

install_solvers() {
(cd $BIN && curl -o bins.zip -sL "https://github.com/GaloisInc/what4-solvers/releases/download/$SOLVER_PKG_VERSION/$BUILD_TARGET_OS-bin.zip" && unzip -o bins.zip && rm bins.zip)
(cd $BIN && curl -o bins.zip -sL "https://github.com/GaloisInc/what4-solvers/releases/download/$SOLVER_PKG_VERSION/$BUILD_TARGET_OS-$BUILD_TARGET_ARCH-bin.zip" && unzip -o bins.zip && rm bins.zip)
cp $BIN/yices_smt2$EXT $BIN/yices-smt2$EXT
chmod +x $BIN/*
export PATH=$BIN:$PATH
Expand Down Expand Up @@ -115,7 +115,7 @@ setup_dist() {

zip_dist() {
: "${VERSION?VERSION is required as an environment variable}"
pkgname="${pkgname:-"$1-$VERSION-$OS_TAG-x86_64"}"
pkgname="${pkgname:-"$1-$VERSION-$OS_TAG-$ARCH_TAG"}"
mv dist "$pkgname"
tar -czf "$pkgname".tar.gz "$pkgname"
rm -rf dist
Expand Down
25 changes: 14 additions & 11 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ on CI, whose CI configurations are located here. We use the following
conventions when picking with operating systems to test:

* For each project, we test the latest LTS release of Ubuntu on the three most
recent stable releases of GHC. In the case of `crux-llvm-build.yml`, we also
test some older versions of GHC.
recent stable releases of GHC.
* In addition, we also test the previous LTS release of Ubuntu on the
`crux-llvm-build.yml` workflow, but only using the latest supported version
of GHC.
* For each project, we test macOS and Windows only using the latest
supported version of GHC. This is because the turnaround time for macOS and
Windows builders on GitHub Actions is longer, so we try to avoid
bottlenecking CI workflows on these operating systems.
`crux-llvm-build.yml` and `crux-mir-build.yml` workflows, but only using a
single version of GHC.
* For each project, we test macOS and Windows only using a single version of
GHC. This is because the turnaround time for macOS and Windows builders on
GitHub Actions is longer, so we try to avoid bottlenecking CI workflows on
these operating systems.

Note that we do not currently run LLVM-related tests on Windows as it is not
straightforward to obtain Windows builds of LLVM that include all of the
developer tools that we need, such as `llvm-link` and `llvm-as`.
Note that:

* We do not currently run LLVM-related tests on Windows, as it is not
straightforward to obtain Windows builds of LLVM that include all of the
developer tools that we need, such as `llvm-link` and `llvm-as`.
* We do not currently run MIR-related tests on Windows, as it is not
straightforward to install `mir-json` on Windows.
5 changes: 3 additions & 2 deletions .github/workflows/crucible-go-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
with:
submodules: true

- uses: haskell/actions/setup@v2
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
Expand Down Expand Up @@ -78,8 +78,9 @@ jobs:
- shell: bash
run: .github/ci.sh install_system_deps
env:
SOLVER_PKG_VERSION: "snapshot-20220902"
SOLVER_PKG_VERSION: "snapshot-20240212"
BUILD_TARGET_OS: ${{ matrix.os }}
BUILD_TARGET_ARCH: ${{ runner.arch }}

- name: Setup Environment Vars
if: runner.os == 'Linux'
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/crucible-jvm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
with:
submodules: true

- uses: haskell/actions/setup@v2
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
Expand Down Expand Up @@ -78,8 +78,9 @@ jobs:
- shell: bash
run: .github/ci.sh install_system_deps
env:
SOLVER_PKG_VERSION: "snapshot-20220902"
SOLVER_PKG_VERSION: "snapshot-20240212"
BUILD_TARGET_OS: ${{ matrix.os }}
BUILD_TARGET_ARCH: ${{ runner.arch }}

- name: Setup Environment Vars
if: runner.os == 'Linux'
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/crucible-wasm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
with:
submodules: true

- uses: haskell/actions/setup@v2
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
Expand Down Expand Up @@ -78,8 +78,9 @@ jobs:
- shell: bash
run: .github/ci.sh install_system_deps
env:
SOLVER_PKG_VERSION: "snapshot-20220902"
SOLVER_PKG_VERSION: "snapshot-20240212"
BUILD_TARGET_OS: ${{ matrix.os }}
BUILD_TARGET_ARCH: ${{ runner.arch }}

- name: Setup Environment Vars
if: runner.os == 'Linux'
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/crux-llvm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,10 @@ jobs:
cabal: ["3.10.1.0"]
ghc: ["9.2.8", "9.4.5", "9.6.2"]
include:
- os: ubuntu-22.04
cabal: 3.10.1.0
ghc: 8.10.7
- os: ubuntu-20.04
cabal: 3.10.1.0
ghc: 9.6.2
- os: macos-12
ghc: 9.2.8
- os: macos-14
cabal: 3.10.1.0
ghc: 9.2.8
- os: windows-2019
Expand All @@ -85,7 +82,7 @@ jobs:
with:
submodules: true

- uses: haskell/actions/setup@v2
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
Expand Down Expand Up @@ -121,8 +118,9 @@ jobs:
- shell: bash
run: .github/ci.sh install_system_deps
env:
SOLVER_PKG_VERSION: "snapshot-20220902"
SOLVER_PKG_VERSION: "snapshot-20240212"
BUILD_TARGET_OS: ${{ matrix.os }}
BUILD_TARGET_ARCH: ${{ runner.arch }}

- name: Setup Environment Vars
if: runner.os == 'Linux'
Expand Down Expand Up @@ -218,12 +216,13 @@ jobs:
- name: Create binary artifact
shell: bash
run: |
NAME="crux-llvm-${{ needs.config.outputs.crux-llvm-version }}-${{ matrix.os }}-x86_64"
NAME="crux-llvm-${{ needs.config.outputs.crux-llvm-version }}-${{ matrix.os }}-${{ runner.arch }}"
echo "NAME=$NAME" >> $GITHUB_ENV
.github/ci.sh bundle_crux_llvm_files
if: github.repository == 'GaloisInc/crucible'
env:
OS_TAG: ${{ matrix.os }}
ARCH_TAG: ${{ runner.arch }}
VERSION: ${{ needs.config.outputs.crux-llvm-version }}

- name: Sign binary artifact
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/crux-mir-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ jobs:
cabal: ["3.10.1.0"]
ghc: ["9.2.8", "9.4.5", "9.6.2"]
include:
- os: macos-12
- os: ubuntu-20.04
cabal: 3.10.1.0
ghc: 9.2.8
- os: macos-14
cabal: 3.10.1.0
ghc: 9.2.8

Expand All @@ -78,7 +81,7 @@ jobs:
with:
submodules: true

- uses: haskell/actions/setup@v2
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
Expand Down Expand Up @@ -121,8 +124,9 @@ jobs:
- shell: bash
run: .github/ci.sh install_system_deps
env:
SOLVER_PKG_VERSION: "snapshot-20220902"
SOLVER_PKG_VERSION: "snapshot-20240212"
BUILD_TARGET_OS: ${{ matrix.os }}
BUILD_TARGET_ARCH: ${{ runner.arch }}

- name: Setup Environment Vars
if: runner.os == 'Linux'
Expand Down Expand Up @@ -174,12 +178,13 @@ jobs:
- name: Create binary artifact
shell: bash
run: |
NAME="crux-mir-${{ needs.config.outputs.crux-mir-version }}-${{ matrix.os }}-x86_64"
NAME="crux-mir-${{ needs.config.outputs.crux-mir-version }}-${{ matrix.os }}-${{ runner.arch }}"
echo "NAME=$NAME" >> $GITHUB_ENV
.github/ci.sh bundle_crux_mir_files
if: github.repository == 'GaloisInc/crucible'
env:
OS_TAG: ${{ matrix.os }}
ARCH_TAG: ${{ runner.arch }}
VERSION: ${{ needs.config.outputs.crux-mir-version }}

- name: Sign binary artifact
Expand All @@ -196,10 +201,10 @@ jobs:
.github/ci.sh sign "${NAME}.tar.gz"

- uses: actions/upload-artifact@v2
if: startsWith(github.ref, 'refs/heads/release-')
if: github.repository == 'GaloisInc/crucible'
with:
path: crux-mir-*.tar.gz*
name: crux-mir-${{ runner.os }}-${{ matrix.ghc }}
name: crux-mir-${{ matrix.os }}-${{ matrix.ghc }}

- uses: actions/cache/save@v3
name: Save cabal store cache
Expand Down
Loading
Loading