Skip to content

Commit

Permalink
Cache Juvix builds in CI workflow (#61)
Browse files Browse the repository at this point in the history
This PR changes the GitHub workflow to use freckle/stack-action to build
the Juvix project. This is the same action we use for the main Juvix
repository.

The benefit is that the Juvix build will use a cache, which should speed
up Juvix stdlib PRs.

* Closes #42
  • Loading branch information
paulcadman authored May 9, 2023
1 parent 66cb98b commit 179d2c9
Showing 1 changed file with 25 additions and 46 deletions.
71 changes: 25 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Juvix standard library CI

on:
push:
branches:
- main
pull_request:
branches:
- main
Expand All @@ -9,70 +12,46 @@ on:
- reopened
- synchronize
- ready_for_review
- review_requested
- closed
schedule:
- cron: '0 3 * * 1'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
ghc: ["9.2.5"]
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v3
name: Cache Stack
id: cache
env:
cache-name: cache-env
with:
path: |
~/.stack
juvix/.stack-work
juvix/.hie
key: ${{ runner.os }}-v1-build-${{ matrix.ghc }}-${{ hashFiles('juvix/src/**/*.hs', 'juvix/app/**/*.hs', 'juvix/test/**/*.hs', 'juvix/package.yaml', 'juvix/stack.yaml') }}
restore-keys: |
${{ runner.os }}-v1-build-${{ matrix.ghc }}-
${{ runner.os }}-v1-build-
${{ runner.os }}-v1-
- uses: haskell/actions/setup@v1
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
enable-stack: true
stack-version: 'latest'

- name: Cache LLVM and Clang
id: cache-llvm
uses: actions/cache@v3
with:
path: |
C:/Program Files/LLVM
./llvm
key: ${{ runner.os }}-llvm-13

- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "13.0"
cached: ${{ steps.cache-llvm.outputs.cache-hit }}

- name: Checkout Juvix
uses: actions/checkout@v3
with:
repository: anoma/juvix
path: juvix
submodules: true

- name: install LLVM
run: |
sudo apt install llvm
- name: Make runtime
run: |
cd juvix
make runtime
- name: Stack setup
id: stack
uses: freckle/stack-action@v4
with:
working-directory: juvix
test: false
fast: false

- name: Install Juvix
run: |
cd juvix
echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH
make install
stack install
- name: Checkout Std Library
uses: actions/checkout@v3
Expand Down

0 comments on commit 179d2c9

Please sign in to comment.