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

Add CI using Stack #313

Merged
merged 4 commits into from
Apr 2, 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
65 changes: 65 additions & 0 deletions .github/workflows/stack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Stack build

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
name: Stack ${{ matrix.ghc }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
ghc: ['9.8', '9.6', '9.4', '9.2', '9.0', '8.10', '8.8', '8.6', '8.4']
include:
- os: macos-latest
ghc: '9.8'
- os: windows-latest
ghc: '9.8'

steps:
- uses: actions/checkout@v4

- uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}
enable-stack: true
cabal-update: false

- name: Restore cache
uses: actions/cache/restore@v4
id: cache
env:
key: ${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ steps.setup.outputs.ghc-version }}
with:
key: ${{ env.key }}-commit-${{ github.sha }}
restore-keys: ${{ env.key }}-
path: |
${{ steps.setup.outputs.stack-root }}
.stack-work

- name: Build dependencies
run: stack build --stack-yaml=stack-${{ matrix.ghc }}.yaml --system-ghc --only-dependencies

- name: Build
run: stack build --stack-yaml=stack-${{ matrix.ghc }}.yaml --system-ghc

- name: Build tests
run: stack test --stack-yaml=stack-${{ matrix.ghc }}.yaml --system-ghc --no-run-tests

- name: Run tests
run: stack test --stack-yaml=stack-${{ matrix.ghc }}.yaml --system-ghc

- name: Save cache
uses: actions/cache/save@v4
if: always()
with:
key: ${{ steps.cache.outputs.cache-primary-key }}
path: |
${{ steps.setup.outputs.stack-root }}
.stack-work
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ prototype-state/offline/
dist-newstyle
.ghc.environment.*
cabal.project.local
stack*.yaml.lock
5 changes: 2 additions & 3 deletions hackage-repo-tool/hackage-repo-tool.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ executable hackage-repo-tool
if !os(windows)
build-depends: unix >= 2.7.2.2 && < 2.9

-- For non-boot libraries we try to support single major versions
-- to reduce the risk of semantic differences
build-depends: microlens >= 0.4.11.2 && < 0.5,
build-depends: microlens >= 0.4.9.1 && < 0.5,
-- microlens-0.4.9.1 is the version in Stackage LTS-12.26 (GHC 8.4)
optparse-applicative >= 0.13 && < 0.19,
tar >= 0.5 && < 0.7,
zlib >= 0.6 && < 0.8,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ library
build-depends: base >= 4.11 && < 4.20,
bytestring >= 0.10.8.2 && < 0.13,
http-client >= 0.4 && < 0.8,
http-types >= 0.12.4 && < 0.13,
http-types >= 0.12.2 && < 0.13,
-- http-types-0.12.2 is the version in Stackage LTS-12.26 (GHC 8.4)
hackage-security >= 0.5 && < 0.7,
network-uri >= 2.6 && < 2.7,
network >= 2.6 && < 3.2
Expand Down
3 changes: 2 additions & 1 deletion hackage-security/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Unreleased
----------

* Drop flag `use-network-uri` and support for `network-2.5`.

* Fix build failure in testsuite with `tar-0.5`
([PR #312](https://github.com/haskell/hackage-security/pull/312)).

0.6.2.5
-------
Expand Down
3 changes: 2 additions & 1 deletion hackage-security/hackage-security.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ test-suite TestSuite
Cabal-syntax < 3.7

-- dependencies exclusive to test-suite
build-depends: tasty >= 1.2 && < 1.6,
build-depends: tasty >= 1.1.0.4 && < 1.6,
-- tasty-1.1.0.4 is the version in Stackage LTS 12.26 (GHC 8.4)
tasty-hunit == 0.10.*,
tasty-quickcheck == 0.10.*,
QuickCheck >= 2.11 && <2.15,
Expand Down
4 changes: 4 additions & 0 deletions hackage-security/tests/TestSuite.hs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ testRepoIndex inMemRepo repo = do
_ -> fail "unexpected index entry content"
_ -> fail "unexpected index path"

#if MIN_VERSION_tar(0,6,0)
testEntries1 :: [Tar.GenEntry Tar.TarPath linkTarget]
#else
testEntries1 :: [Tar.Entry]
#endif
testEntries1 = either (const []) (pure . (`Tar.fileEntry` testEntrycontent))
(Tar.toTarPath False "foo/preferred-versions")
testEntrycontent = BS.pack "foo >= 1"
Expand Down
6 changes: 4 additions & 2 deletions precompute-fileinfo/precompute-fileinfo.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ executable precompute-fileinfo
filepath >= 1.4.2 && < 1.5,
optparse-applicative >= 0.13 && < 0.19,
SHA >= 1.6.4 && < 1.7,
tar >= 0.6.0 && < 0.7,
zlib >= 0.6.3 && < 0.7
tar >= 0.5.0.2 && < 0.7,
-- tar-0.5.0.2 is the version in Stackage LTS-12.26 (GHC 8.4)
zlib >= 0.6.2 && < 0.7
-- zlib-0.6.2 is the version in Stackage LTS-12.26 (GHC 8.4)
hs-source-dirs: src
default-language: Haskell2010
default-extensions: RecordWildCards
Expand Down
18 changes: 18 additions & 0 deletions stack-8.10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
resolver: lts-18.28
packages:
- example-client
- hackage-repo-tool
- hackage-root-tool
- hackage-security
- hackage-security-HTTP
- hackage-security-curl
- hackage-security-http-client
- precompute-fileinfo

flags:
example-client:
cabal-syntax: false
hackage-repo-tool:
cabal-syntax: false
hackage-security:
cabal-syntax: false
27 changes: 27 additions & 0 deletions stack-8.4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
resolver: lts-12.26
packages:
- example-client
- hackage-repo-tool
- hackage-root-tool
- hackage-security
- hackage-security-HTTP
- hackage-security-curl
- hackage-security-http-client
- precompute-fileinfo

flags:
example-client:
cabal-syntax: false
hackage-repo-tool:
cabal-syntax: false
hackage-security:
cabal-syntax: false
lukko: false
# LTS 12 does not have lukko yet

extra-deps:
- Cabal-syntax-3.6.0.0
- aeson-1.4.3.0
## aeson-1.4.3.0 is the newest that works with the other deps in LTS 12
## aeson-1.4.4.0 asks for time-compat >= 1.9.2.2
# - lukko-0.1.1.3
24 changes: 24 additions & 0 deletions stack-8.6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
resolver: lts-14.27
packages:
- example-client
- hackage-repo-tool
- hackage-root-tool
- hackage-security
- hackage-security-HTTP
- hackage-security-curl
- hackage-security-http-client
- precompute-fileinfo

flags:
example-client:
cabal-syntax: false
hackage-repo-tool:
cabal-syntax: false
hackage-security:
cabal-syntax: false
lukko: false
# LTS 14 does not have lukko yet

extra-deps:
- Cabal-syntax-3.6.0.0
# - lukko-0.1.1.3
21 changes: 21 additions & 0 deletions stack-8.8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resolver: lts-16.31
packages:
- example-client
- hackage-repo-tool
- hackage-root-tool
- hackage-security
- hackage-security-HTTP
- hackage-security-curl
- hackage-security-http-client
- precompute-fileinfo

flags:
example-client:
cabal-syntax: false
hackage-repo-tool:
cabal-syntax: false
hackage-security:
cabal-syntax: false

extra-deps:
- Cabal-syntax-3.6.0.0
18 changes: 18 additions & 0 deletions stack-9.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
resolver: lts-19.33
packages:
- example-client
- hackage-repo-tool
- hackage-root-tool
- hackage-security
- hackage-security-HTTP
- hackage-security-curl
- hackage-security-http-client
- precompute-fileinfo

flags:
example-client:
cabal-syntax: false
hackage-repo-tool:
cabal-syntax: false
hackage-security:
cabal-syntax: false
18 changes: 18 additions & 0 deletions stack-9.2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
resolver: lts-20.26
packages:
- example-client
- hackage-repo-tool
- hackage-root-tool
- hackage-security
- hackage-security-HTTP
- hackage-security-curl
- hackage-security-http-client
- precompute-fileinfo

flags:
example-client:
cabal-syntax: false
hackage-repo-tool:
cabal-syntax: false
hackage-security:
cabal-syntax: false
18 changes: 18 additions & 0 deletions stack-9.4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
resolver: lts-21.25
packages:
- example-client
- hackage-repo-tool
- hackage-root-tool
- hackage-security
- hackage-security-HTTP
- hackage-security-curl
- hackage-security-http-client
- precompute-fileinfo

flags:
example-client:
cabal-syntax: true
hackage-repo-tool:
cabal-syntax: true
hackage-security:
cabal-syntax: true
18 changes: 18 additions & 0 deletions stack-9.6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
resolver: lts-22.15
packages:
- example-client
- hackage-repo-tool
- hackage-root-tool
- hackage-security
- hackage-security-HTTP
- hackage-security-curl
- hackage-security-http-client
- precompute-fileinfo

flags:
example-client:
cabal-syntax: true
hackage-repo-tool:
cabal-syntax: true
hackage-security:
cabal-syntax: true
18 changes: 18 additions & 0 deletions stack-9.8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
resolver: nightly-2024-04-02
packages:
- example-client
- hackage-repo-tool
- hackage-root-tool
- hackage-security
- hackage-security-HTTP
- hackage-security-curl
- hackage-security-http-client
- precompute-fileinfo

flags:
example-client:
cabal-syntax: true
hackage-repo-tool:
cabal-syntax: true
hackage-security:
cabal-syntax: true
18 changes: 0 additions & 18 deletions stack.yaml

This file was deleted.

1 change: 1 addition & 0 deletions stack.yaml