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 artifacts using GHC 9.2.7, exclude Windows GHC 8.10.7 job #1962

Merged
merged 4 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
29 changes: 1 addition & 28 deletions .github/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,6 @@ extract_exe() {
$IS_WIN || chmod +x "$2/$name"
}

retry() {
echo "Attempting with retry:" "$@"
local n=1
while true; do
if "$@"; then
break
else
if [[ $n -lt 3 ]]; then
sleep $n # don't retry immediately
((n++))
echo "Command failed. Attempt $n/3:"
else
echo "The command has failed after $n attempts."
return 1
fi
fi
done
}

setup_dist_bins() {
if $IS_WIN; then
is_exe "dist/bin" "saw" && return
Expand Down Expand Up @@ -66,15 +47,7 @@ build() {
if [[ "$ENABLE_HPC" == "true" ]]; then
cat cabal.project.ci-hpc >> cabal.project.local
fi
if ! retry cabal v2-build "$@" "${pkgs[@]}"; then
if [[ "$RUNNER_OS" == "macOS" ]]; then
RyanGlScott marked this conversation as resolved.
Show resolved Hide resolved
echo "Working around a dylib issue on macos by removing the cache and trying again"
cabal v2-clean
retry cabal v2-build "$@" "${pkgs[@]}"
else
return 1
fi
fi
cabal v2-build "$@" "${pkgs[@]}"
}

# Gather and tar up all HPC coverage files and binaries
Expand Down
34 changes: 23 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Overall configuration notes:
# - Artifact uploads for binaries are from GHC 8.10.7
# - Artifact uploads for binaries are from GHC 9.2.7
# - Builds for Ubuntu happen on 22.04. We also include a single configuration
# for 20.04 to increase our Linux coverage.
# - Docker builds happen nightly, on manual invocation, and on release branch commits
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
# coverage of possible Linux configurations. Since we already run the
# tests with the newest LTS release, we won't bother testing this one.
- os: ubuntu-20.04
ghc: "8.10.7"
ghc: "9.2.7"
cabal: "3.10.1.0"
run-tests: false
hpc: false
Expand All @@ -96,6 +96,18 @@ jobs:
cabal: "3.10.1.0"
run-tests: true
hpc: true
exclude:
# We exclude the GHC 8.10.7 job on Windows, as it is known to suffer
# from a hard-to-diagnose memory-related issue that does not affect
# later versions of GHC on Windows. (See
# https://github.com/GaloisInc/saw-script/issues/1961.) When we drop
# support for 8.10 entirely from SAW's support Window, we can remove
# this part of the matrix entirely.
- os: windows-2019
ghc: "8.10.7"
cabal: "3.10.1.0"
run-tests: true
hpc: false
outputs:
cabal-test-suites-json: ${{ steps.cabal-test-suites.outputs.targets-json }}
steps:
Expand Down Expand Up @@ -171,7 +183,7 @@ jobs:
dest: dist-tests

- uses: actions/upload-artifact@v2
if: "matrix.ghc == '8.10.7'"
if: "matrix.ghc == '9.2.7'"
with:
path: dist-tests
name: dist-tests-${{ matrix.os }}
Expand All @@ -188,14 +200,14 @@ jobs:
- shell: bash
run: .github/ci.sh zip_dist_with_solvers $NAME-with-solvers

- if: matrix.ghc == '8.10.7' && github.event.pull_request.head.repo.fork == false
- if: matrix.ghc == '9.2.7' && github.event.pull_request.head.repo.fork == false
shell: bash
env:
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
run: .github/ci.sh sign $NAME.tar.gz

- if: matrix.ghc == '8.10.7' && github.event.pull_request.head.repo.fork == false
- if: matrix.ghc == '9.2.7' && github.event.pull_request.head.repo.fork == false
shell: bash
env:
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
Expand All @@ -205,7 +217,7 @@ jobs:
##########################################################################
# We upload an archive containing SAW, and also and archive containing SAW
# and the set of possible SMT solvers, but only for our "primary"
# distribution (currently: GHC 8.10.7). These archives are utilized in
# distribution (currently: GHC 9.2.7). These archives are utilized in
# subsequent CI jobs, but are also published for external users, and are
# therefore signed.
#
Expand All @@ -220,23 +232,23 @@ jobs:
# In the next 3 steps we check that `matrix.hpc == false` so that if the
# distribution version matches the HPC version, the HPC build artifacts do
# not clobber the non-HPC distribution artifacts.
- if: matrix.ghc == '8.10.7' && matrix.hpc == false
- if: matrix.ghc == '9.2.7' && matrix.hpc == false
uses: actions/upload-artifact@v2
with:
name: ${{ steps.config.outputs.name }} (GHC ${{ matrix.ghc }})
path: "${{ steps.config.outputs.name }}.tar.gz*"
if-no-files-found: error
retention-days: ${{ needs.config.outputs.retention-days }}

- if: matrix.ghc == '8.10.7' && matrix.hpc == false
- if: matrix.ghc == '9.2.7' && matrix.hpc == false
uses: actions/upload-artifact@v2
with:
name: ${{ steps.config.outputs.name }}-with-solvers (GHC ${{ matrix.ghc }})
path: "${{ steps.config.outputs.name }}-with-solvers.tar.gz*"
if-no-files-found: error
retention-days: ${{ needs.config.outputs.retention-days }}

- if: matrix.ghc == '8.10.7' && matrix.run-tests && matrix.hpc == false
- if: matrix.ghc == '9.2.7' && matrix.run-tests && matrix.hpc == false
uses: actions/upload-artifact@v2
with:
path: dist/bin
Expand Down Expand Up @@ -715,7 +727,7 @@ jobs:
- hmac-failure
- awslc
- blst
ghc: ["8.10.7"]
ghc: ["9.2.7"]
steps:
- uses: actions/checkout@v2
- run: |
Expand Down Expand Up @@ -768,7 +780,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
ghc: ["8.10.7"]
ghc: ["9.2.7"]
steps:
- uses: actions/checkout@v2
- run: |
Expand Down
6 changes: 3 additions & 3 deletions saw-remote-api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ USER saw
WORKDIR /home/saw
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8
COPY cabal.GHC-8.10.7.config cabal.project.freeze
COPY cabal.GHC-9.2.7.config cabal.project.freeze
ENV PATH=/home/saw/ghcup-download/bin:/home/saw/.ghcup/bin:$PATH
RUN mkdir -p /home/saw/ghcup-download/bin && \
curl -L https://downloads.haskell.org/~ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 -o /home/saw/ghcup-download/bin/ghcup && \
chmod +x /home/saw/ghcup-download/bin/ghcup
RUN mkdir -p /home/saw/.ghcup && \
ghcup --version && \
ghcup install cabal 3.8.1.0 && \
ghcup install ghc 8.10.7 && \
ghcup set ghc 8.10.7
ghcup install ghc 9.2.7 && \
ghcup set ghc 9.2.7
RUN cabal v2-update && cabal v2-build -j exe:saw-remote-api
RUN mkdir -p /home/saw/rootfs/usr/local/bin
RUN cp $(cabal v2-exec which saw-remote-api) /home/saw/rootfs/usr/local/bin/saw-remote-api
Expand Down
6 changes: 3 additions & 3 deletions saw/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ USER saw
WORKDIR /home/saw
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8
COPY cabal.GHC-8.10.7.config cabal.project.freeze
COPY cabal.GHC-9.2.7.config cabal.project.freeze
ENV PATH=/home/saw/ghcup-download/bin:/home/saw/.ghcup/bin:$PATH
RUN mkdir -p /home/saw/ghcup-download/bin && \
curl -L https://downloads.haskell.org/~ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 -o /home/saw/ghcup-download/bin/ghcup && \
chmod +x /home/saw/ghcup-download/bin/ghcup
RUN mkdir -p /home/saw/.ghcup && \
ghcup --version && \
ghcup install cabal 3.8.1.0 && \
ghcup install ghc 8.10.7 && \
ghcup set ghc 8.10.7
ghcup install ghc 9.2.7 && \
ghcup set ghc 9.2.7
RUN cabal v2-update
RUN cabal v2-build
RUN mkdir -p /home/saw/rootfs/usr/local/bin
Expand Down