From e1d1bc2143170aa613e125920c55471a23b53446 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Sun, 6 Aug 2023 19:26:00 +0100 Subject: [PATCH] Use pre-made Actions for Haskell workflows (#54) * Give nightly workflow a proper name * Use pre-made Action for nightly workflow * Use pre-made Action for build workflow * Pin action versions --- .github/workflows/haskell.yml | 36 +++----------------------- .github/workflows/stackage-nightly.yml | 26 ++----------------- 2 files changed, 5 insertions(+), 57 deletions(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index f095f62..89f9cb3 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -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 diff --git a/.github/workflows/stackage-nightly.yml b/.github/workflows/stackage-nightly.yml index 24403ef..fa4fb20 100644 --- a/.github/workflows/stackage-nightly.yml +++ b/.github/workflows/stackage-nightly.yml @@ -1,4 +1,4 @@ -name: stackage-nightly +name: "Stackage Nightly" on: schedule: @@ -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