Skip to content

Commit

Permalink
Use pre-made Actions for Haskell workflows (#54)
Browse files Browse the repository at this point in the history
* Give nightly workflow a proper name

* Use pre-made Action for nightly workflow

* Use pre-made Action for build workflow

* Pin action versions
  • Loading branch information
mbg authored Aug 6, 2023
1 parent 57d937f commit e1d1bc2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 57 deletions.
36 changes: 3 additions & 33 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,37 +30,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: haskell/actions/setup@v2
id: install-haskell
- uses: mbg/actions/stack/build@v0.1
with:
stack-no-global: true
enable-stack: true
stack-version: "latest"

- name: Cache .stack
id: cache-stack
uses: actions/cache@v3
with:
path: ${{ steps.install-haskell.outputs.stack-root }}
key: ${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles(format('{0}.yaml', matrix.resolver)) }}-${{ hashFiles('wai-saml2.cabal') }}
restore-keys: |
${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles(format('{0}.yaml', matrix.resolver)) }}-
${{ runner.os }}-${{ matrix.resolver }}-
- name: Install dependencies
run: stack --stack-yaml=${{ matrix.resolver }}.yaml --no-terminal build --test --haddock --only-dependencies --fast

- name: Build
run: |
stack --stack-yaml=${{ matrix.resolver }}.yaml --no-terminal build --fast \
--test --no-run-tests \
--haddock --haddock-arguments='-odocs'
- name: Upload documentation
uses: actions/upload-artifact@v3
with:
name: docs-${{ matrix.resolver }}
path: docs/

- name: Test
run: stack --stack-yaml=${{ matrix.resolver }}.yaml --no-terminal test --fast
resolver: ${{ matrix.resolver }}
upload-docs: true
26 changes: 2 additions & 24 deletions .github/workflows/stackage-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: stackage-nightly
name: "Stackage Nightly"

on:
schedule:
Expand All @@ -16,26 +16,4 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: haskell/actions/setup@v2
id: install-haskell
with:
stack-no-global: true
enable-stack: true
stack-version: "latest"

- name: Initialise stack.yaml with the nightly snapshot
run: |
rm -f stack.yaml && stack init --resolver nightly
- name: Cache .stack
id: cache-stack
uses: actions/cache@v3
with:
path: ${{ steps.install-haskell.outputs.stack-root }}
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('wai-saml2.cabal') }}
restore-keys: |
${{ runner.os }}-${{ hashFiles('stack.yaml') }}-
- name: Build with the nightly snapshot
run: |
stack build --resolver nightly --haddock --test --bench --no-run-benchmarks
- uses: mbg/actions/stack/nightly@v0.1

0 comments on commit e1d1bc2

Please sign in to comment.