Skip to content

Commit

Permalink
Merge pull request #72 from fimad/github-ci
Browse files Browse the repository at this point in the history
Migrate to Github actions for CI
  • Loading branch information
fimad authored Mar 3, 2024
2 parents bda31d1 + 303dbb6 commit c8cfa72
Show file tree
Hide file tree
Showing 11 changed files with 129 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .travis/stack-lts-12.yaml → .ci/stack-lts-12.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ packages:
- ../prometheus-proc
- ../wai-middleware-prometheus
extra-deps:
- data-sketches-0.3.1.0
- data-sketches-core-0.1.0.0
- unix-memory-0.1.2
resolver: lts-12.26
2 changes: 2 additions & 0 deletions .travis/stack-lts-16.yaml → .ci/stack-lts-16.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ packages:
- ../prometheus-proc
- ../wai-middleware-prometheus
extra-deps:
- data-sketches-0.3.1.0
- data-sketches-core-0.1.0.0
- unix-memory-0.1.2
resolver: lts-16.6
1 change: 1 addition & 0 deletions .travis/stack-lts-2.yaml → .ci/stack-lts-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ packages:
extra-deps:
- atomic-primops-0.8.2
- clock-0.8
- data-sketches-0.3.1.0
resolver: lts-2.22
10 changes: 10 additions & 0 deletions .ci/stack-lts-21.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
flags: {}
packages:
- ../example/
- ../prometheus-client
- ../prometheus-metrics-ghc
- ../prometheus-proc
- ../wai-middleware-prometheus
extra-deps:
- unix-memory-0.1.2
resolver: lts-21.25
10 changes: 10 additions & 0 deletions .ci/stack-lts-22.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
flags: {}
packages:
- ../example/
- ../prometheus-client
- ../prometheus-metrics-ghc
- ../prometheus-proc
- ../wai-middleware-prometheus
extra-deps:
- unix-memory-0.1.2
resolver: lts-22.12
2 changes: 2 additions & 0 deletions .travis/stack-lts-3.yaml → .ci/stack-lts-3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ packages:
- ../wai-middleware-prometheus
extra-deps:
- clock-0.8
- data-sketches-0.3.1.0
- data-sketches-core-0.1.0.0
resolver: lts-3.22
10 changes: 10 additions & 0 deletions .ci/stack-nightly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
flags: {}
packages:
- ../example/
- ../prometheus-client
- ../prometheus-metrics-ghc
- ../prometheus-proc
- ../wai-middleware-prometheus
extra-deps:
- unix-memory-0.1.2
resolver: nightly-2024-03-01
82 changes: 82 additions & 0 deletions .github/workflows/stack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# https://github.com/haskell/actions/tree/main/setup

name: build
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

permissions:
contents: read

jobs:
build:
name: Stack resolver ${{ matrix.stackage-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
stackage-version:
- stack.yaml
- .ci/stack-nightly.yaml
- .ci/stack-lts-22.yaml
- .ci/stack-lts-21.yaml
- .ci/stack-lts-16.yaml

steps:
- uses: actions/checkout@v3

- uses: haskell-actions/setup@v2
name: Set up stack ${{ matrix.stackage-version }}
id: setup
with:
enable-stack: true
stack-version: latest

- uses: actions/cache/restore@v3
name: Restore cached ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-stack-globa-version-${{ matrix.stackage-version }}l-${{ hashFiles(matrix.stackage-version) }}-${{ hashFiles('**/*.cabal') }}
restore-keys: |
${{ runner.os }}-stack-global-version-${{ matrix.stackage-version }}-${{ hashFiles(matrix.stackage-version) }}
${{ runner.os }}-stack-global-version-${{ matrix.stackage-version }}-
- uses: actions/cache/restore@v3
name: Restore cached .stack-work
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-version-${{ matrix.stackage-version }}-${{ hashFiles(matrix.stackage-version) }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/*.hs') }}
restore-keys: |
${{ runner.os }}-stack-work-version-${{ matrix.stackage-version }}-${{ hashFiles(matrix.stackage-version) }}-${{ hashFiles('**/*.cabal') }}-
${{ runner.os }}-stack-work-version-${{ matrix.stackage-version }}-${{ hashFiles(matrix.stackage-version) }}-
${{ runner.os }}-stack-work-version-${{ matrix.stackage-version }}-
- name: Install dependencies
run: stack build --stack-yaml ${{ matrix.stackage-version }} --dependencies-only --test --bench

# Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.

- uses: actions/cache/save@v3
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-stack-global-version-${{ matrix.stackage-version }}-${{ hashFiles(matrix.stackage-version) }}-${{ hashFiles('**/*.cabal') }}
- uses: actions/cache/save@v3
name: Cache .stack-work
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-version-${{ matrix.stackage-version }}-${{ hashFiles(matrix.stackage-version) }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/*.hs') }}

- name: Build
run: stack build --stack-yaml ${{ matrix.stackage-version }}

- name: Run tests
run: stack test --stack-yaml ${{ matrix.stackage-version }}

- name: Run benchmarks
run: stack bench --stack-yaml ${{ matrix.stackage-version }}

- name: Build documentation
run: stack haddock --stack-yaml ${{ matrix.stackage-version }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ dist/
.cabal-sandbox/
cabal.sandbox.config
cabal.config
/.stack-work
.stack-work
*/*.yaml.lock
.devcontainer
4 changes: 4 additions & 0 deletions prometheus-proc/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# HEAD

* Relax bounds on base, unix, and text to support GHC 9.6 and 9.8

# 0.1.5.0 -- 2023-05-11

* Support base-4.17 and (GHC 9.2 & GHC 9.4)
Expand Down
6 changes: 3 additions & 3 deletions prometheus-proc/prometheus-proc.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ source-repository head

library
exposed-modules: Prometheus.Metric.Proc
build-depends: base >=4.10 && <4.18
build-depends: base >=4.10 && <5
, directory >= 1.2.5.0 && < 1.4
, filepath >=1.4 && <1.5
, prometheus-client >= 1.0.0 && < 1.2
, regex-applicative >=0.3 && <0.4
, text >= 0.7 && < 2.1
, unix >=2.7 && <2.8
, text >= 0.7 && < 2.2
, unix >=2.7 && <2.9
, unix-memory >=0.1 && <0.2
hs-source-dirs: src
default-language: Haskell2010

0 comments on commit c8cfa72

Please sign in to comment.