Skip to content

Commit

Permalink
Break out ghc_compat_test into separate workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonchinn178 committed Jul 3, 2023
1 parent 9c7e9f2 commit 25ae00b
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 41 deletions.
45 changes: 4 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,47 +51,10 @@ jobs:
oldest: true

name: ghc_compat_test (${{ matrix.ghc_version }})
runs-on: ubuntu-latest

steps:
-
uses: actions/checkout@v3
-
id: setup
name: Set up GHC ${{ matrix.ghc_version }}
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc_version }}
-
name: Configure the build
run:
cabal configure
--enable-test
--test-options=--color=always
--test-show-details=streaming
-
if: ${{ matrix.oldest }}
name: Use oldest dependencies
run:
cabal configure --enable-append
--prefer-oldest
--constraint 'aeson-qq >= 0.7.4'
-
name: Get build plan
run: cabal build --dry-run
-
name: Get current month to clear cache
run: echo "CURR_MONTH=$(date +%B)" | tee -a "$GITHUB_ENV"
-
uses: actions/cache@v3
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ runner.os }}-cabal-cache-${{ env.CURR_MONTH }}-${{ matrix.ghc_version }}-${{ hashFiles('**/plan.json') }}
restore-keys: |
${{ runner.os }}-cabal-cache-${{ env.CURR_MONTH }}-${{ matrix.ghc_version }}-
-
name: Build + Test
run: cabal build && cabal exec -- cabal test
uses: ./.github/workflows/ghc-compat-test.yml
with:
ghc_version: ${{ matrix.ghc_version }}
oldest: ${{ matrix.oldest || false }}

lint:
runs-on: ubuntu-latest
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/ghc-compat-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
on:
workflow_call:
inputs:
ghc_version:
required: true
type: string
oldest:
required: false
type: boolean

jobs:
run:
runs-on: ubuntu-latest

steps:
-
uses: actions/checkout@v3
-
id: setup
name: Set up GHC ${{ inputs.ghc_version }}
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ inputs.ghc_version }}
-
name: Configure the build
run:
cabal configure
--enable-test
--test-options=--color=always
--test-show-details=streaming
-
if: ${{ inputs.oldest }}
name: Use oldest dependencies
run:
cabal configure --enable-append
--prefer-oldest
--constraint 'aeson-qq >= 0.7.4'
-
name: Get build plan
run: cabal build --dry-run
-
name: Get current month to clear cache
run: echo "CURR_MONTH=$(date +%B)" | tee -a "$GITHUB_ENV"
-
uses: actions/cache@v3
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ runner.os }}-cabal-cache-${{ env.CURR_MONTH }}-${{ inputs.ghc_version }}-${{ hashFiles('**/plan.json') }}
restore-keys: |
${{ runner.os }}-cabal-cache-${{ env.CURR_MONTH }}-${{ inputs.ghc_version }}-
-
name: Build + Test
run: cabal build && cabal exec -- cabal test

0 comments on commit 25ae00b

Please sign in to comment.