Skip to content

Commit

Permalink
Fix caching and build from github too
Browse files Browse the repository at this point in the history
  • Loading branch information
facundominguez committed May 16, 2024
1 parent e85c1d7 commit ba5637b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 7 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/cabal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ jobs:
- "9.2.8"
- "9.4.7"
- "9.6.3"
- "9.8.1"
include:
- repo: "hackage"
- ghc: "9.8.1"
repo: "github"
- ghc: "9.8.1"
repo: "hackage"

steps:
- uses: actions/checkout@v3
Expand All @@ -33,14 +38,24 @@ jobs:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}

- name: Configure the build
run: |
if [ ${{ matrix.repo }} == "github" ]
then
cp cabal.project.github cabal.project
fi
cabal configure --enable-tests --enable-benchmarks --disable-documentation
# generate dist-newstyle/cache/plan.json
cabal build all --dry-run
- name: Cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle
uses: actions/cache@v3
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal-${{ hashFiles('**/*.cabal') }}
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal-${{ hashFiles('**/*.cabal', './dist-newstyle/cache/plan.json') }}

- name: Update package list
run: cabal update
Expand Down
22 changes: 18 additions & 4 deletions .github/workflows/stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
build:
name: ghc ${{ matrix.ghc }}
name: ghc ${{ matrix.ghc }} - ${{ matrix.repo }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -15,7 +15,12 @@ jobs:
- "9.2.8"
- "9.4.7"
- "9.6.3"
- "9.8.1"
include:
- repo: "hackage"
- ghc: "9.8.1"
repo: "github"
- ghc: "9.8.1"
repo: "hackage"

steps:
- uses: actions/checkout@v3
Expand All @@ -35,13 +40,22 @@ jobs:
enable-stack: true
stack-version: "latest"

- name: Configure the build
run: |
if [ ${{ matrix.repo }} == "hackage" ]
then
sed "s/\.\././g" ./stack/stack-${{ matrix.ghc }}.yaml > stack.yaml
fi
# generate stack.yaml.lock
stack build --no-terminal --dry-run
- name: Cache ~/.stack and .stack-work
uses: actions/cache@v3
with:
path: |
~/.stack
.stack-work
key: ${{ runner.os }}-${{ matrix.ghc }}-stack-${{ hashFiles('**/*.cabal', './stack/stack-${{ matrix.ghc }}.yaml') }}
key: ${{ runner.os }}-${{ matrix.ghc }}-stack-${{ hashFiles('**/*.cabal', './stack.yaml', './stack.yaml.lock') }}

- name: Build
run: stack build --no-terminal --stack-yaml=./stack/stack-${{ matrix.ghc }}.yaml
run: stack build --no-terminal
2 changes: 1 addition & 1 deletion stack/stack-9.8.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extra-deps:
- liquidhaskell-0.9.8.1
- liquidhaskell-boot-0.9.8.1
- liquid-fixpoint-0.9.6.3
- liquid-prelude-0.9.2.8.1
- liquid-prelude-0.9.2.8.1@rev:1
- liquid-vector-0.13.1.0.1

nix:
Expand Down

0 comments on commit ba5637b

Please sign in to comment.