diff --git a/.github/run.sh b/.github/run.sh index e23a654..ac46c23 100755 --- a/.github/run.sh +++ b/.github/run.sh @@ -46,13 +46,13 @@ if [[ -z "$CI" ]]; then ormolu_mode="inplace" fi -green='\033[1;32m' -no_color='\033[0m' +green=$(tput -Txterm-256color setaf 2) +default=$(tput -Txterm-256color sgr0) for m in "${manifests[@]}"; do name="$(dirname "$(readlink -f "$m")")" name="$(basename "$name")" - printf "Project dir: %b%s%b\n" "$green" "$name" "$no_color" + printf "Project dir: %b%s%b\n" "$green" "$name" "$default" if (( no_test == 0 )); then # profiling https://stackoverflow.com/a/40922201/839733 @@ -64,13 +64,13 @@ for m in "${manifests[@]}"; do if [[ -x "$(command -v hlint)" ]]; then hlint "$name/src" else - printf "hlint not found" + printf "%bhlint not found%b\n" "$red" "$default" fi if [[ -x "$(command -v ormolu)" ]]; then ormolu -m "$ormolu_mode" $(find "$name/src" -name '*.hs') else - printf "ormolu not found" + printf "%bormolu not found%b\n" "$red" "$default" fi fi done diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa6b0ca..04fe4b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,7 @@ -on: [push] - name: CI +on: [push, workflow_dispatch] + jobs: build-and-test: runs-on: ubuntu-latest @@ -12,18 +12,18 @@ jobs: uses: haskell-actions/setup@v2 with: enable-stack: true - stack-no-global: true - - - name: Test - run: .github/run.sh --no-lint - name: 'Install HLint' uses: haskell-actions/hlint-setup@v2 - name: 'Run HLint' - run: hlint --ignore-glob '*/test/*.hs' . +- run: hlint --ignore-glob '*/test/*.hs' . - - name: 'Run Ormolu' + - name: 'Check Formatting' uses: haskell-actions/run-ormolu@v16 with: pattern: '*/src/*.hs' + mode: check + + - name: 'Test and Lint' + run: .github/run.sh --no-lint \ No newline at end of file