-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add stack files to gitignore * modify CI - rename haskell-ci to main-push - add main-pull to run on pull requests - include tests and linting in main-pull See #68 and #69
- Loading branch information
Showing
3 changed files
with
66 additions
and
3 deletions.
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,62 @@ | ||
name: CI Pull Request | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
on-main-pull-request: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
|
||
- name: Set up Haskell | ||
uses: haskell-actions/[email protected] | ||
with: | ||
ghc-version: '9.6.3' | ||
cabal-version: '3.10.2.1' | ||
|
||
- name: Cache Cabal | ||
uses: actions/[email protected] | ||
env: | ||
cache-name: cache-cabal | ||
with: | ||
path: ~/.cabal | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Cache GHC | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.ghcup | ||
key: ${{ runner.os }}-ghcup-${{ hashFiles('**/*.cabal') }} | ||
restore-keys: | | ||
${{ runner.os }}-ghcup- | ||
- name: Install stylish-haskell | ||
run: cabal install stylish-haskell | ||
|
||
- name: Run stylish-haskell | ||
run: | | ||
find . -name '*.hs' -exec sh -c 'for file do stylish-haskell --inplace "$file"; done' sh {} + | ||
- name: Commit stylish-haskell changes | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: Auto-format with stylish-haskell | ||
commit_user_name: GitHub Action | ||
commit_user_email: [email protected] | ||
branch: ${{ github.head_ref }} | ||
|
||
- name: Build package | ||
run: | | ||
cabal update | ||
cabal new-build all |
4 changes: 2 additions & 2 deletions
4
.github/workflows/haskell-ci.yml → .github/workflows/main-push.yml
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,8 @@ | ||
name: Haskell CI | ||
name: CI Push | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
branches: [ main ] | ||
|
||
workflow_dispatch: | ||
|
||
|
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