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

Enable macOS CI #6

Merged
merged 1 commit into from
Jun 24, 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
22 changes: 10 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
cabal-file: confer.cabal
ubuntu-version: 'latest'
macos: 'macos-13'
macos-version: 'latest'
version: 0.1.7.0
tests:
name: ${{ matrix.ghc }} on ${{ matrix.os }}
Expand All @@ -28,11 +28,11 @@ jobs:
strategy:
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
steps:
- name: "Install tools"
run: |
sudo apt install upx-ucl
- name: Checkout base repo
uses: actions/checkout@v4
- name: "Install tools"
run: |
.github/workflows/install-tools.sh
- name: Set up Haskell
id: setup-haskell
uses: haskell-actions/setup@v2
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
upx -9 $CONFER_EXEC
DIR=$(dirname $CONFER_EXEC)
FILE=$(basename $CONFER_EXEC)
CONFER_EXEC_TAR=confer-head-${{ runner.os }}-x86_64.tar.gz
CONFER_EXEC_TAR=confer-head-${{ runner.os }}-$(uname -m).tar.gz
tar -czvf $CONFER_EXEC_TAR -C $DIR $FILE
echo CONFER_EXEC_TAR=$CONFER_EXEC_TAR >> $GITHUB_ENV
- name: Upload the confer-head executable
Expand All @@ -73,9 +73,7 @@ jobs:
name: Build statically linked using alpine
runs-on: ubuntu-latest
container: 'alpine:3.19'
needs: ['generate-matrix', 'tests']
strategy:
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
needs: ['tests']
steps:
- name: Install extra dependencies
shell: sh
Expand All @@ -90,7 +88,7 @@ jobs:
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
ghc-version: '9.8.2'
cabal-version: 'latest'

- name: Configure
Expand All @@ -102,8 +100,8 @@ jobs:
- uses: actions/cache@v4
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os }}-ghc-${{ matrix.ghc }}-cabal-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ runner.os }}-ghc-${{ matrix.ghc }}-
key: ${{ runner.os }}-ghc-9.8.2-cabal-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ runner.os }}-ghc-9.8.2-

- name: Enable statically linked executables
run: |
Expand All @@ -122,7 +120,7 @@ jobs:
upx -9 $CONFER_EXEC
DIR=$(dirname $CONFER_EXEC)
FILE=$(basename $CONFER_EXEC)
CONFER_EXEC_TAR=confer-head-${{ runner.os }}-static-x86_64.tar.gz
CONFER_EXEC_TAR=confer-head-${{ runner.os }}-static-$(uname -m).tar.gz
tar -czvf $CONFER_EXEC_TAR -C $DIR $FILE
echo CONFER_EXEC_TAR=$CONFER_EXEC_TAR >> $GITHUB_ENV

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/install-tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

case "$(uname -s)" in
Linux*) sudo apt install upx-ucl;;
Darwin*) brew install --build-from-source upx;;
esac
Loading