Skip to content

Commit

Permalink
fixup: add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nicuveo committed Feb 19, 2025
1 parent 8987c6c commit b3bfca7
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: code validation

on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: freckle/stack-action@v5
with:
stack-build-arguments: ""
test: false

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: changed-files
uses: tj-actions/changed-files@v45
with:
files: "**/*.hs"
- uses: haskell-actions/hlint-setup@v2
- run: echo ${{ toJSON(steps.changed-files.all_changed_and_modified_files) }}
- if: steps.changed-files.outputs.all_changed_and_modified_files
uses: haskell-actions/hlint-run@v2
with:
path: ${{ toJSON(steps.changed-files.all_changed_and_modified_files) }}

formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: changed-files
uses: tj-actions/changed-files@v45
with:
files: "**/*.hs"
- run: echo ${{ steps.changed-files.outputs }}
- if: steps.changed-files.outputs.all_changed_and_modified_files
env:
TARGETS: ${{ steps.changed-files.outputs.all_changed_and_modified_files }}
run: |
curl -sL https://raw.github.com/haskell/stylish-haskell/master/scripts/latest.sh | sh -s .
stylish-haskell -i $TARGETS
for f in $(git diff --name-only --diff-filter=M); do
echo "::error file=$f::File is not formatted properly."
done
1 change: 1 addition & 0 deletions pietre.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ library
Lang.Pietre.Stages.Assembling
Lang.Pietre.Stages.Generation
Lang.Pietre.Stages.Linking
Lang.Pietre.Stages.Lowering
Lang.Pietre.Stages.Parsing
Lang.Pietre.Stages.Parsing.Lexer
Lang.Pietre.Stages.Parsing.Monad
Expand Down

0 comments on commit b3bfca7

Please sign in to comment.