-
Notifications
You must be signed in to change notification settings - Fork 25
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 GitHub Actions CI #50
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
cd77010
Remove old stack build plans
cdepillabout f6a4f38
Rename stack.yaml to stack-9.0.yaml
cdepillabout a1dd4fe
Update stack.yaml for ghc-8.10 and ghc-9.0
cdepillabout 7f2da42
Add stack.yaml for ghc-9.4 and ghc-9.6
cdepillabout f6564b4
Add stack.yaml as softlink pointing to stack-9.6.yaml
cdepillabout ed3477b
Change Example.hs module name to Main
cdepillabout f0b401e
Regenerate the stack.yaml.lock file
cdepillabout 57ca655
Add the Example.hs file to the .cabal file as an executable
cdepillabout 27fa227
Add GitHub Actions CI
cdepillabout File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
cabal: | ||
name: cabal / ghc-${{ matrix.ghc }} / ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
# - macOS-latest | ||
cabal: | ||
- "latest" | ||
ghc: | ||
- "8.10.7" | ||
- "9.0.2" | ||
- "9.2.8" | ||
- "9.4.8" | ||
- "9.6.3" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: haskell-actions/setup@v2 | ||
id: setup-haskell-cabal | ||
name: Setup Haskell | ||
with: | ||
ghc-version: ${{ matrix.ghc }} | ||
cabal-version: ${{ matrix.cabal }} | ||
|
||
- uses: actions/cache@v3 | ||
name: Cache cabal-store | ||
with: | ||
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} | ||
key: ${{ matrix.os }}-${{ matrix.ghc }}-cabal | ||
|
||
- name: Build | ||
run: | | ||
cabal update | ||
cabal build package:prometheus --enable-tests --enable-benchmarks --write-ghc-environment-files=always --flags="buildexamples" | ||
|
||
# TODO: Actually add tests | ||
# - name: Test | ||
# run: | | ||
# cabal test package:prometheus --enable-tests | ||
|
||
stack: | ||
name: stack ${{ matrix.resolver }} / ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
# - macOS-latest | ||
stack: ["latest"] | ||
resolver: | ||
- "--stack-yaml ./stack-8.10.yaml" | ||
- "--stack-yaml ./stack-9.0.yaml" | ||
- "--stack-yaml ./stack-9.2.yaml" | ||
- "--stack-yaml ./stack-9.4.yaml" | ||
- "--stack-yaml ./stack-9.6.yaml" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: haskell-actions/setup@v2 | ||
name: Setup Haskell Stack | ||
with: | ||
stack-version: ${{ matrix.stack }} | ||
enable-stack: true | ||
|
||
- uses: actions/cache@v3 | ||
name: Cache ~/.stack | ||
with: | ||
path: ~/.stack | ||
key: ${{ matrix.os }}-stack-${{ matrix.resolver }} | ||
|
||
- name: Build | ||
run: | | ||
stack build --test --bench --no-run-tests --no-run-benchmarks --flag prometheus:buildexamples | ||
|
||
# TODO: Actually add tests | ||
# - name: Test | ||
# run: | | ||
# stack test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
--- | ||
|
||
resolver: lts-18.28 | ||
flags: {} | ||
packages: | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
--- | ||
|
||
resolver: lts-16.5 | ||
resolver: lts-19.33 | ||
flags: {} | ||
packages: | ||
- '.' | ||
- "." | ||
extra-deps: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
resolver: lts-21.25 | ||
flags: {} | ||
packages: | ||
- "." | ||
extra-deps: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
resolver: lts-14.27 | ||
--- | ||
resolver: lts-22.0 | ||
flags: {} | ||
packages: | ||
- '.' | ||
- "." | ||
extra-deps: [] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
./stack-9.6.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not support macos?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume we support OSX, but I've seen weird errors before in GitHub Actions for OSX, so I usually default to leaving it out. I could add it in if we want it.
Although I don't think there is any OS-/arch-specific code in this repo, so it is unlikely we would catch any bugs with it. It would probably just slow down the CI time.