Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions .github/workflows/build-and-test-windows.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,42 @@
name: Build and test on Ubuntu
name: Build and test

on:
push:
branches: [master]
pull_request:

jobs:
build-with-stack:
build-with-stack-windows:
name: Build and test with Stack on Windows
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache Stack state and GHC install
uses: actions/cache@v4.2.3
with:
path: |
~\AppData\Local\Programs\stack
~\AppData\Roaming\stack
.stack-work
key: >-
${{ runner.os }}-stack-${{
hashFiles('**/stack.yaml.lock')
}}-${{
hashFiles('**/package.yaml')
}}
restore-keys: |-
${{ runner.os }}-stack-${{ hashFiles('**/stack.yaml.lock') }}-
${{ runner.os }}-stack-
- name: Set up GHC with Stack on Windows
run: stack setup
- name: Build project
run: >-
stack build --fast --hpack-force --lock-file=error-on-write
--ghc-options="-Werror"
- name: Run tests
run: stack test --fast
build-with-stack-ubuntu:
name: Build and test with Stack
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -59,8 +89,6 @@ jobs:
# Cabal matrix build:
# This job builds and tests the project using multiple GHC versions.
# - Ensures compatibility with stable compiler versions (e.g. 9.4.7, 9.6.6).
# - Tests with 'latest' GHC to catch breaking changes early.
# - Uses '--allow-newer=base' with 'latest' to relax bounds for future compatibility.
# - Enables the 'dump-ast' flag to ensure internal tooling builds correctly.
name: Build and test with Cabal (GHC ${{ matrix.ghc }})
runs-on: ubuntu-latest
Expand All @@ -87,26 +115,22 @@ jobs:
uses: actions/cache@v4.2.3
with:
path: |
~/.ghc
~/.cabal/store
${{ steps.setup-ghc.outputs.cabal-store }}
~/.cabal/packages
dist-newstyle
key: >-
${{ runner.os }}-cabal-${{
steps.setup-ghc.outputs.ghc-version
matrix.ghc
}}-${{
hashFiles('**/package.yaml')
}}
restore-keys: |
${{ runner.os }}-cabal-${{ steps.setup-ghc.outputs.ghc-version }}-
${{ runner.os }}-cabal-${{ matrix.ghc }}-
- name: Update Cabal package index
run: cabal update
- name: Configure project
run: |
FLAGS=""
if [ "${MATRIX_GHC}" = "latest" ]; then
FLAGS="--allow-newer=base"
fi
cabal configure --enable-tests --flags=dump-ast $FLAGS --ghc-options="-Werror"
cabal configure --enable-tests --flags=dump-ast --ghc-options="-Werror"
- name: Build project (GHC ${{ steps.setup-ghc.outputs.ghc-version }})
run: cabal build all
- name: Run tests (GHC ${{ steps.setup-ghc.outputs.ghc-version }})
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/future-proofing.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Build and test with latest GHC

on:
push:
branches: [master]
Expand All @@ -15,16 +17,19 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get latest supported GHC version
id: get-ghc
uses: webdevred/get-supported-ghc@v0.0.1
- name: Set up GHC latest and Cabal
id: setup-ghc
uses: haskell-actions/setup@v2.8.0
with:
ghc-version: latest
ghc-version: "${{ steps.get-ghc.outputs.ghc-version }}"
cabal-version: latest
cabal-update: false
cabal-update: true
- name: Log GHC and Cabal outputs
run: |
echo "GHC Version: ${{ steps.setup-ghc.outputs.ghc-version }}"
echo "GHC Version: ${{ steps.get-ghc.outputs.ghc-version }}"
echo "Cabal Store Path: ${{ steps.setup-ghc.outputs.cabal-store }}"
- name: Cache GHC, Cabal store, and build artifacts
uses: actions/cache@v4.2.3
Expand All @@ -34,18 +39,16 @@ jobs:
${{ steps.setup-ghc.outputs.cabal-store }}
key: >-
${{ runner.os }}-cabal-${{
steps.setup-ghc.outputs.ghc-version
steps.get-ghc.outputs.ghc-version
}}-${{
hashFiles('**/package.yaml')
}}
restore-keys: |
${{ runner.os }}-cabal-${{ steps.setup-ghc.outputs.ghc-version }}-
- name: Update Cabal package index
run: cabal update
${{ runner.os }}-cabal-${{ steps.get-ghc.outputs.ghc-version }}-
- name: Configure project
shell: bash
run: |
cabal configure --enable-tests --flags=dump-ast --allow-newer=base --ghc-options="-Werror"
cabal configure --enable-tests --flags=dump-ast --ghc-options="-Werror"
- name: Build project (GHC latest)
run: cabal build all
- name: Run tests (GHC latest)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Build and test on Windows](https://github.com/webdevred/jbeam_edit/actions/workflows/build-and-test-windows.yaml/badge.svg?branch=master)](https://github.com/webdevred/jbeam_edit/actions/workflows/build-and-test-windows.yaml)
[![Build and test on Ubuntu](https://github.com/webdevred/jbeam_edit/actions/workflows/build-and-test-ubuntu.yaml/badge.svg?branch=master)](https://github.com/webdevred/jbeam_edit/actions/workflows/build-and-test-ubuntu.yaml)
[![Build and test with latest GHC](https://github.com/webdevred/jbeam_edit/actions/workflows/future-proofing.yaml/badge.svg?branch=master)](https://github.com/webdevred/jbeam_edit/actions/workflows/future-proofing.yaml)

<!--toc:start-->
- [JBeam Tool in Haskell](#jbeam-tool-in-haskell)
Expand Down
Loading