Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate test matrix from tested-with GHCs #308

Merged
merged 1 commit into from
Apr 12, 2024
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
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Set update schedule for GitHub Actions

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
55 changes: 31 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,56 @@ on:
- "master"

jobs:
build:
name: ghc ${{ matrix.ghc }}
generateMatrix:
name: "Generate matrix from cabal"
runs-on: ubuntu-latest
strategy:
matrix:
ghc: ["8.10", "9.0", "9.2"]
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout base repo
uses: actions/checkout@v2
- name: Extract the tested GHC versions
id: set-matrix
run: |
wget https://github.com/Kleidukos/get-tested/releases/download/v0.1.5.0/get-tested-0.1.5.0-linux-amd64 -O get-tested
chmod +x get-tested
./get-tested --ubuntu tree-sitter/tree-sitter.cabal >> $GITHUB_OUTPUT
Comment on lines +20 to +25
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey this is cool

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually in the meantime it gained a GitHub Action. I'll send a follow-up PR. :)

build:
name: ${{ matrix.ghc }} on ${{ matrix.os }}
needs: generateMatrix
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{ fromJSON(needs.generateMatrix.outputs.matrix) }}

steps:
- uses: actions/checkout@v2
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'

- uses: haskell/actions/setup@v1
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}

- uses: actions/cache@v2
name: Cache ~/.cabal/packages
with:
path: ~/.cabal/packages
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal-packages
- uses: actions/cache@v2
name: Cache ~/.cabal/store
- name: Cache
uses: actions/[email protected]
with:
path: ~/.cabal/store
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal-store
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os }}-ghc-${{ matrix.ghc }}-cabal-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ runner.os }}-ghc-${{ matrix.ghc }}-
- uses: actions/cache@v2
name: Cache dist-newstyle
with:
path: dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc }}-repo-dist

- name: Install dependencies
run: |
git submodule update -i --recursive
cabal v2-update
cabal v2-configure --enable-benchmarks --enable-tests --write-ghc-environment-files=always -j2 -O0
cabal v2-build --only-dependencies all
cabal update
cabal configure --enable-benchmarks --enable-tests --write-ghc-environment-files=always -j2 -O0
cabal build --only-dependencies all

- name: Build & test
run: |
cabal v2-build all
cabal v2-test all
cabal v2-haddock all
cabal v2-sdist all
cabal build all
cabal test all
cabal haddock all
cabal sdist all
for p in tree-sitter* ; do echo "$p" ; cd "$p" ; cabal check ; cd ..; done
5 changes: 5 additions & 0 deletions tree-sitter/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### v0.9.0.3

* Support `base-4.14` at least (GHC 8.10.7)
* Support latest minor versions of 8.10, 9.0, 9.2 and 9.4

### v0.9.0.2

* Remove `fused-effects` dependency.
Expand Down
21 changes: 9 additions & 12 deletions tree-sitter/tree-sitter.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ category: Parsing, Tree-sitter
build-type: Simple

tested-with:
GHC == 8.10.1
GHC == 9.0.1
GHC == 9.2.1
GHC == 8.10.7
GHC == 9.0.2
GHC == 9.2.8
GHC == 9.4.8

extra-source-files: vendor/tree-sitter/lib/src/**/*.c
, vendor/tree-sitter/lib/src/**/*.h
Expand All @@ -38,14 +39,10 @@ common common
-Wno-name-shadowing
-Wno-safe
-Wno-unsafe
if (impl(ghc >= 8.6))
ghc-options: -Wno-star-is-type
if (impl(ghc >= 8.8))
ghc-options: -Wno-missing-deriving-strategies
if (impl(ghc >= 8.10))
ghc-options:
-Wno-missing-safe-haskell-mode
-Wno-prepositive-qualified-module
-Wno-star-is-type
-Wno-missing-deriving-strategies
-Wno-missing-safe-haskell-mode
-Wno-prepositive-qualified-module
Comment on lines +42 to +45
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call dropping the conditionals.

if (impl(ghc >= 9.2))
ghc-options:
-Wno-missing-kind-signatures
Expand All @@ -55,7 +52,7 @@ library
import: common
hs-source-dirs: src
build-depends:
, base >= 4.12 && < 5
, base >= 4.14.3.0 && < 5
, bytestring >= 0.10.8.2 && < 0.13
, containers ^>= 0.6.0.1
, directory ^>= 1.3
Expand Down
Loading