diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 507e792c..64103495 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -110,60 +110,60 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - - name: Install devbox - uses: jetify-com/devbox-install-action@v0.11.0 - with: - enable-cache: true - - - name: Update cabal registry - run: devbox run -- cabal update - - - name: List exact cabal deps - run: | - devbox run -- cabal freeze --only-dependencies - sed -i '' -e '$ d' cabal.project.freeze - - - name: Cache cabal store - uses: actions/cache@v4 - with: - path: ~/.cabal/store - key: deps-${{ matrix.os }}-${{ hashFiles('devbox.lock', 'cabal.project.freeze') }} - - - name: Cache build artifacts - uses: actions/cache@v4 - with: - path: dist-newstyle - key: dist-${{ matrix.os }}-${{ github.sha }} - restore-keys: dist-${{ matrix.os }}- - - - name: Cache node_modules - uses: actions/cache@v4 - with: - path: node_modules - key: npm-${{ matrix.os }}-${{ hashFiles('devbox.lock', 'package-lock.json') }} - - - name: Install npm dependencies - run: devbox run -- npm install - - - name: Configure - run: devbox run -- cabal configure --enable-tests -O2 - - - name: Build - run: devbox run -- cabal build - - - name: Tests - run: devbox run test - - - name: Move binary - run: cp `devbox run -- cabal list-bin .` ./gren - - - uses: actions/upload-artifact@v4 - with: - name: gren-${{ matrix.os }} - path: gren - retention-days: 14 + steps: + - uses: actions/checkout@v4 + + - name: Cache ghcup + uses: actions/cache@v4 + with: + path: ~/.ghcup + key: ghcup-${{ matrix.os }}-${{ env.ghc }} + + - id: setup-haskell + uses: haskell/actions/setup@v2 + with: + ghc-version: ${{ env.ghc }} + cabal-version: ${{ env.cabal }} + + - name: List exact cabal deps + run: | + cabal freeze --only-dependencies + sed -i '' -e '$ d' cabal.project.freeze + + - name: Cache cabal store + uses: actions/cache@v4 + with: + path: ${{ steps.setup-haskell.outputs.cabal-store }} + key: deps-${{ matrix.os }}-${{ env.ghc }}-${{ hashFiles('cabal.project.freeze') }} + restore-keys: deps-${{ matrix.os }}-${{ env.ghc }}- + + - name: Cache build artifacts + uses: actions/cache@v4 + with: + path: dist-newstyle + key: dist-${{ matrix.os }}-${{ env.ghc }}-${{ github.sha }} + restore-keys: dist-${{ matrix.os }}-${{ env.ghc }}- + + - name: Configure + run: cabal configure --enable-tests -O2 + + - name: Build + run: cabal build + + - name: Tests + run: cabal test + + - name: Move binary + run: cp `cabal list-bin .` ./gren + + - name: Strip + run: strip gren + + - uses: actions/upload-artifact@v4 + with: + name: gren-${{ matrix.os }} + path: gren + retention-days: 14 windows: runs-on: windows-latest