-
Notifications
You must be signed in to change notification settings - Fork 8
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
Small improvements to CI #132
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
fbe5c89
Use cabal.project.local for CI settings
DigitalBrains1 76a9d33
Run CI for pushes to main
DigitalBrains1 0bf6604
Check Haddock, sdist for both packages
DigitalBrains1 409db0a
Also create cache when CI fails
DigitalBrains1 84a5530
Bump versions in Stack and CI to latest
DigitalBrains1 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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
#!/bin/bash | ||
|
||
set -uo pipefail | ||
|
||
if [[ "$check_haddock" != @(True|False) ]]; then | ||
echo "check_haddock: Expected True or False, got \"$check_haddock\"" >&2 | ||
exit 1 | ||
fi | ||
sed <.ci/cabal.project.local.in >cabal.project.local " | ||
s/__CHECK_HADDOCK__/$check_haddock/" | ||
s/__CHECK_HADDOCK__/$check_haddock/ | ||
s/__CLASH_VERSION__/$clash_version/" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
package * | ||
documentation: __CHECK_HADDOCK__ | ||
|
||
package clash-protocols-base | ||
documentation: False | ||
ghc-options: -Werror | ||
|
||
package clash-protocols | ||
documentation: False | ||
ghc-options: -Werror | ||
|
||
constraints: | ||
clash-prelude == __CLASH_VERSION__ |
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,6 +1,6 @@ | ||
#!/bin/bash | ||
set -xeou pipefail | ||
|
||
cabal v2-run unittests --constraint=clash-prelude==$clash_version -fci --enable-tests | ||
cabal v2-run doctests --constraint=clash-prelude==$clash_version -fci --enable-tests | ||
cabal v2-sdist clash-protocols | ||
cabal v2-run unittests --enable-tests | ||
cabal v2-run doctests --enable-tests | ||
cabal v2-sdist all |
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,10 +1,10 @@ | ||
name: CI | ||
|
||
# Trigger the workflow on all pull requests and pushes/merges to master branch | ||
# Trigger the workflow on all pull requests and pushes/merges to main branch | ||
on: | ||
pull_request: | ||
push: | ||
branches: [master] | ||
branches: [main] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Soooo.... why did the pushes to main not trigger a CI run? :-S |
||
|
||
|
||
concurrency: | ||
|
@@ -22,13 +22,19 @@ jobs: | |
- name: Setup Stack / GHC | ||
uses: haskell-actions/setup@v2 | ||
with: | ||
ghc-version: '9.4.8' | ||
cabal-version: '3.10.2.1' | ||
ghc-version: '9.8.4' | ||
cabal-version: '3.14.1.1' | ||
enable-stack: true | ||
stack-version: 'latest' | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v4 | ||
# Ask Stack to use system GHC instead of installing its own copy | ||
- name: Use system GHC | ||
run: | | ||
stack config set system-ghc --global true | ||
|
||
- name: Restore cached dependencies | ||
uses: actions/cache/restore@v4 | ||
id: cache | ||
with: | ||
path: ~/.stack | ||
key: ${{ runner.os }}-ghc-${{ matrix.ghc }}-${{ github.ref }}-${{ github.sha }} | ||
|
@@ -37,10 +43,19 @@ jobs: | |
${{ runner.os }}-ghc-${{ matrix.ghc }}-${{ github.ref }}- | ||
${{ runner.os }}-ghc-${{ matrix.ghc }}- | ||
|
||
# Ask Stack to use system GHC instead of installing its own copy | ||
- name: Use system GHC | ||
run: | | ||
stack config set system-ghc --global true | ||
- name: Install dependencies | ||
run: stack build --test --only-dependencies | ||
|
||
# Cache dependencies already at this point, so that we do not have to | ||
# rebuild them should the subsequent steps fail | ||
- name: Save cached dependencies | ||
uses: actions/cache/save@v4 | ||
# Trying to save over an existing cache gives distracting | ||
# "Warning: Cache save failed." since they are immutable | ||
if: ${{ steps.cache.outputs.cache-hit != 'true' }} | ||
with: | ||
path: ~/.stack | ||
key: ${{ runner.os }}-ghc-${{ matrix.ghc }}-${{ github.ref }}-${{ github.sha }} | ||
|
||
- name: Test with Stack | ||
run: | | ||
|
@@ -56,7 +71,7 @@ jobs: | |
clash: | ||
- "1.8.2" | ||
cabal: | ||
- "3.10" | ||
- "3.14.1.1" | ||
ghc: | ||
- "9.0.2" | ||
- "9.2.8" | ||
|
@@ -65,11 +80,11 @@ jobs: | |
- "9.10.1" | ||
include: | ||
- check_haddock: "False" | ||
- ghc: "9.6.4" | ||
- ghc: "9.6.6" | ||
check_haddock: "True" | ||
os: "ubuntu-latest" | ||
clash: "1.8.2" | ||
cabal: "3.10" | ||
cabal: "3.14.1.1" | ||
|
||
env: | ||
check_haddock: ${{ matrix.check_haddock }} | ||
|
@@ -95,8 +110,14 @@ jobs: | |
cabal v2-freeze | ||
mv cabal.project.freeze frozen | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v4 | ||
- name: Restore cached dependencies | ||
uses: actions/cache/restore@v4 | ||
id: cache | ||
env: | ||
key: | ||
${{ runner.os }}-ghc-${{ matrix.ghc }}-cabal-${{ | ||
steps.setup-haskell.outputs.cabal-version }}${{ | ||
matrix.project-variant }} | ||
with: | ||
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} | ||
key: ${{ runner.os }}-ghc-${{ matrix.ghc }}-${{ matrix.clash }}-${{ hashFiles('frozen') }} | ||
|
@@ -105,9 +126,23 @@ jobs: | |
${{ runner.os }}-ghc-${{ matrix.ghc }}-${{ matrix.clash }}- | ||
${{ runner.os }}-ghc-${{ matrix.ghc }}- | ||
|
||
- name: Install dependencies | ||
run: cabal v2-build all --enable-tests --only-dependencies | ||
|
||
# Cache dependencies already at this point, so that we do not have to | ||
# rebuild them should the subsequent steps fail | ||
- name: Save cached dependencies | ||
uses: actions/cache/save@v4 | ||
# Trying to save over an existing cache gives distracting | ||
# "Warning: Cache save failed." since they are immutable | ||
if: ${{ steps.cache.outputs.cache-hit != 'true' }} | ||
with: | ||
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} | ||
key: ${{ runner.os }}-ghc-${{ matrix.ghc }}-${{ matrix.clash }}-${{ hashFiles('frozen') }} | ||
|
||
- name: Build | ||
run: | | ||
cabal build all --constraint=clash-prelude==$clash_version -fci | ||
cabal v2-build all --enable-tests | ||
|
||
- name: Test | ||
run: | | ||
|
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 |
---|---|---|
|
@@ -9,11 +9,6 @@ license-file: LICENSE | |
author: Martijn Bastiaan, QBayLogic B.V. | ||
maintainer: Martijn Bastiaan <[email protected]> | ||
|
||
flag ci | ||
Description: Running on CI? Used to set fail-on-warning flag. | ||
Manual: True | ||
Default: False | ||
|
||
flag large-tuples | ||
description: | ||
Generate instances for classes such as `Units` and `TaggedBundle` for tuples | ||
|
@@ -75,9 +70,6 @@ common common-options | |
-- a no-specialize pragma to every function with a blackbox. | ||
-fno-worker-wrapper | ||
|
||
if flag(ci) | ||
ghc-options: -Werror | ||
|
||
default-language: Haskell2010 | ||
build-depends: | ||
base >= 4.15.0.0, | ||
|
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
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.
I had no idea you could chain commands like this. Cool.