Skip to content

Commit

Permalink
Merge pull request #5 from nuttycom/github_ci
Browse files Browse the repository at this point in the history
Add CI testing for ghc versions 7.10.3 through 8.10.1
  • Loading branch information
nuttycom authored May 16, 2024
2 parents cc38915 + d751dca commit 29fe33c
Show file tree
Hide file tree
Showing 4 changed files with 222 additions and 22 deletions.
172 changes: 172 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
{
"jobs": {
"build": {
"env": {
"CONFIG": "--enable-tests --enable-benchmarks ${{ matrix.bounds }}"
},
"runs-on": "${{ matrix.os }}",
"steps": [
{
"uses": "actions/checkout@v4"
},
{
"id": "setup-haskell-cabal",
"uses": "haskell-actions/setup@v2",
"with": {
"cabal-version": "3.10.2.1",
"ghc-version": "${{ matrix.ghc }}"
}
},
{
"run": "cabal v2-freeze $CONFIG"
},
{
"uses": "actions/cache@v4",
"with": {
"key": "${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}",
"path": "${{ steps.setup-haskell-cabal.outputs.cabal-store }}\ndist-newstyle\n"
}
},
{
"run": "cabal v2-build all $CONFIG"
},
{
"run": "cabal v2-test all $CONFIG"
},
{
"run": "mv dist-newstyle/cache/plan.json plan-${{ runner.os }}-${{ matrix.ghc }}${{ matrix.bounds }}.json"
},
{
"name": "Upload build plan as artifact",
"uses": "actions/upload-artifact@v4",
"with": {
"name": "plan-${{ runner.os }}-${{ matrix.ghc }}${{ matrix.bounds }}",
"path": "plan-${{ runner.os }}-${{ matrix.ghc }}${{ matrix.bounds }}.json"
}
}
],
"strategy": {
"fail-fast": false,
"matrix": {
"bounds": [
"--prefer-oldest",
""
],
"exclude": [
{
"ghc": "7.10.3",
"os": "ubuntu-22.04"
},
],
"ghc": [
"7.10.3",
"8.0.2",
"8.2.2",
"8.4.1",
"8.6.1",
"8.8.1",
"8.10.1",
],
"os": [
"macos-13",
"ubuntu-22.04",
"windows-2022"
]
}
}
},
"check-bounds": {
"if": "always()",
"needs": [
"build"
],
"runs-on": "ubuntu-22.04",
"steps": [
{
"uses": "actions/checkout@v4"
},
{
"id": "setup-haskell-cabal",
"uses": "haskell-actions/setup@v2",
"with": {
"cabal-version": "3.10.2.1",
"ghc-version": "9.6.3"
}
},
{
"run": "## TODO: Remove the manual cloning once cabal-plan-bounds >0.1.5.1\n## is released. Currently, it’s needed because of\n## nomeata/cabal-plan-bounds#19.\ngit clone https://github.com/nomeata/cabal-plan-bounds\ncd cabal-plan-bounds\ncabal install cabal-plan-bounds\n"
},
{
"name": "download Cabal plans",
"uses": "actions/download-artifact@v4",
"with": {
"merge-multiple": true,
"path": "plans",
"pattern": "plan-*"
}
},
{
"name": "Cabal plans considered in generated bounds",
"run": "find plans/"
},
{
"name": "check if bounds have changed",
"run": "diffs=\"$(find . -name '*.cabal' -exec \\\n cabal-plan-bounds \\\n --dry-run \\\n \\\n plans/*.json \\\n --cabal {} \\;)\"\nif [[ -n \"$diffs\" ]]; then\n echo \"$diffs\"\n exit 1\nfi\n"
}
]
},
"check-licenses": {
"if": "always()",
"needs": [
"build"
],
"runs-on": "ubuntu-22.04",
"steps": [
{
"uses": "actions/checkout@v4"
},
{
"id": "setup-haskell-cabal",
"uses": "haskell-actions/setup@v2",
"with": {
"cabal-version": "3.10.2.1",
"ghc-version": "8.10.1"
}
},
{
"run": "cabal install cabal-plan -flicense-report"
},
{
"name": "download Cabal plans",
"uses": "actions/download-artifact@v4",
"with": {
"merge-multiple": true,
"path": "plans",
"pattern": "plan-*"
}
},
{
"run": "mkdir -p dist-newstyle/cache\nmv plans/plan-${{ runner.os }}-8.10.1.json dist-newstyle/cache/plan.json\n"
},
{
"name": "check if licenses have changed",
"run": "{\n echo \"**NB**: This captures the licenses associated with a particular set of dependency versions. If your own build solves differently, it’s possible that the licenses may have changed, or even that the set of dependencies itself is different. Please make sure you run [\\`cabal-plan license-report\\`](https://hackage.haskell.org/package/cabal-plan) on your own components rather than assuming this is authoritative.\"\n echo\n cabal-plan license-report true-name:lib:true-name\n} >\"docs/license-report.md\"\n\ngit diff --exit-code docs/license-report.md\n"
}
]
}
},
"name": "CI",
"on": {
"pull_request": {
"types": [
"opened",
"synchronize"
]
},
"push": {
"branches": [
"master"
]
}
}
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/dist/
dist/
dist-newstyle
24 changes: 24 additions & 0 deletions docs/license-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**NB**: This captures the licenses associated with a particular set of dependency versions. If your own build solves differently, it’s possible that the licenses may have changed, or even that the set of dependencies itself is different. Please make sure you run [`cabal-plan license-report`](https://hackage.haskell.org/package/cabal-plan) on your own components rather than assuming this is authoritative.

# Dependency License Report

Bold-faced **`package-name`**s denote standard libraries bundled with `ghc-8.10.1`.

## Direct dependencies of `true-name:lib:true-name`

| Name | Version | [SPDX](https://spdx.org/licenses/) License Id | Description | Also depended upon by |
| --- | --- | --- | --- | --- |
| **`base`** | [`4.14.0.0`](http://hackage.haskell.org/package/base-4.14.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/base-4.14.0.0/src/LICENSE) | Basic libraries | *(core library)* |
| **`template-haskell`** | [`2.16.0.0`](http://hackage.haskell.org/package/template-haskell-2.16.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/template-haskell-2.16.0.0/src/LICENSE) | Support library for Template Haskell | |

## Indirect transitive dependencies

| Name | Version | [SPDX](https://spdx.org/licenses/) License Id | Description | Depended upon by |
| --- | --- | --- | --- | --- |
| **`array`** | [`0.5.4.0`](http://hackage.haskell.org/package/array-0.5.4.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/array-0.5.4.0/src/LICENSE) | Mutable and immutable arrays | `deepseq` |
| **`deepseq`** | [`1.4.4.0`](http://hackage.haskell.org/package/deepseq-1.4.4.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/deepseq-1.4.4.0/src/LICENSE) | Deep evaluation of data structures | `pretty` |
| **`ghc-boot-th`** | [`8.10.1`](http://hackage.haskell.org/package/ghc-boot-th-8.10.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-boot-th-8.10.1/src/LICENSE) | Shared functionality between GHC and the `template-haskell` library | `template-haskell` |
| **`ghc-prim`** | [`0.6.1`](http://hackage.haskell.org/package/ghc-prim-0.6.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-prim-0.6.1/src/LICENSE) | GHC primitives | *(core library)* |
| **`integer-gmp`** | [`1.0.3.0`](http://hackage.haskell.org/package/integer-gmp-1.0.3.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/integer-gmp-1.0.3.0/src/LICENSE) | Integer library based on GMP | *(core library)* |
| **`pretty`** | [`1.1.3.6`](http://hackage.haskell.org/package/pretty-1.1.3.6) | [`BSD-3-Clause`](http://hackage.haskell.org/package/pretty-1.1.3.6/src/LICENSE) | Pretty-printing library | `template-haskell` |

45 changes: 24 additions & 21 deletions true-name.cabal
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cabal-version: 3.0

name: true-name
version: 0.1.0.4
synopsis: Template Haskell hack to violate module abstractions
Expand All @@ -8,49 +10,50 @@ description:
constructors, record fields or class methods―a slightly less unsafe way
to violate another module's abstractions than @unsafeCoerce@.
.
A few <https://github.com/liyang/true-name/blob/master/test/sanity.hs quick examples>.
.
I'm too lazy to keep a changelog, but I do write <https://github.com/liyang/true-name/commits/master detailed commit messages>.
homepage: https://github.com/liyang/true-name
license: BSD3
A few <https://github.com/haskell-github-trust/true-name/blob/master/test/sanity.hs quick examples>.
homepage: https://github.com/haskell-github-trust/true-name
license: BSD-3-Clause
license-file: LICENSE
author: Liyang HU
maintainer: true-name@liyang.hu
maintainer: kris@nutty.land
copyright: © 2014−2021 Liyang HU
category: Data, Unsafe
build-type: Simple
cabal-version: >= 1.10
stability: experimental
tested-with:
GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3,
GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5,
GHC == 8.8.3,
GHC == 7.10.3,
GHC == 8.0.2,
GHC == 8.2.2,
GHC == 8.4.1,
GHC == 8.6.1,
GHC == 8.8.1,
GHC == 8.10.1

source-repository head
type: git
location: https://github.com/liyang/true-name
location: https://github.com/haskell-github-trust/true-name

library
common buildenv
default-language: Haskell2010
build-depends:
base ^>=4.8.2 || ^>=4.9.1 || ^>=4.10.1 || ^>=4.11.0 || ^>=4.12.0 || ^>=4.13.0 || ^>=4.14.0,
template-haskell ^>=2.10.0 || ^>=2.11.1 || ^>=2.12.0 || ^>=2.13.0 || ^>=2.14.0 || ^>=2.15.0 || ^>=2.16.0,

library
import: buildenv
exposed-modules:
Unsafe.TrueName
build-depends:
base >= 4.5 && < 5,
template-haskell >= 2.7
ghc-options: -Wall

test-suite sanity
default-language: Haskell2010
import: buildenv
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: sanity.hs
build-depends:
base,
containers,
time,
template-haskell,
true-name
containers ^>=0.5.6 || ^>=0.6.0,
time ^>=1.1.2 || ^>=1.5.0 || ^>=1.6.0 || ^>=1.8.0 || ^>=1.9,
true-name,
ghc-options: -Wall

-- vim: et sw=4 ts=4 sts=4:
Expand Down

0 comments on commit 29fe33c

Please sign in to comment.