diff --git a/.github/workflows/hlint-from-scratch.yml b/.github/workflows/hlint-from-scratch.yml index ade04f7..b4b17fe 100644 --- a/.github/workflows/hlint-from-scratch.yml +++ b/.github/workflows/hlint-from-scratch.yml @@ -10,12 +10,15 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu, macos, windows] + os: [ubuntu, macos] steps: - uses: actions/checkout@v4 - run: stack upgrade - run: brew install automake if: matrix.os == 'macos' + - run: cabal update + - run: cabal install apply-refact + if: matrix.os == 'ubuntu' - run: |- echo "GHCLIB_AZURE='1'" >> $GITHUB_ENV echo "repo_dir=$(mktemp -d)" >> $GITHUB_ENV diff --git a/hlint-from-scratch.sh b/hlint-from-scratch.sh index 3883447..5a36592 100755 --- a/hlint-from-scratch.sh +++ b/hlint-from-scratch.sh @@ -236,7 +236,7 @@ else fi sha_ghc_lib_parser=$(shasum -a 256 "$repo_dir"/ghc-lib/ghc-lib-parser-"$version".tar.gz | awk '{ print $1 }') -# temp disable while i focus on minimal set of github actions +# temp disabled while i focus on minimal set of github actions if false; then if [ -z "$GHC_FLAVOR" ]; then # If the above worked out, update CI.hs. @@ -400,17 +400,34 @@ if ! [ "$no_builds" == --no-builds ]; then # Again, wrong to pass $resolver_flag here. # Build hlint. - eval "C_INCLUDE_PATH=$(xcrun --show-sdk-path)/usr/include/ffi" "stack" "$stack_yaml_flag" "build" + if [ $uname == 'Darwin' ]; then + eval "C_INCLUDE_PATH=$(xcrun --show-sdk-path)/usr/include/ffi" "stack" "$stack_yaml_flag" "build" + else + eval "stack" "$stack_yaml_flag" "build" + fi # Run its tests. - eval "C_INCLUDE_PATH=$(xcrun --show-sdk-path)/usr/include/ffi" "stack" "$stack_yaml_flag" "run" "--" "--test" + if [ $uname == 'Darwin' ]; then + eval "C_INCLUDE_PATH=$(xcrun --show-sdk-path)/usr/include/ffi" "stack" "$stack_yaml_flag" "run" "--" "--test" + else + eval "stack" "$stack_yaml_flag" "run" "--" "--test" + fi # Test there are no changes to 'hints.md'. - eval "C_INCLUDE_PATH=$(xcrun --show-sdk-path)/usr/include/ffi" "stack" "$stack_yaml_flag" "run" "--" "hlint" "--generate-summary" + if [ $uname == 'Darwin' ]; then + eval "C_INCLUDE_PATH=$(xcrun --show-sdk-path)/usr/include/ffi" "stack" "$stack_yaml_flag" "run" "--" "hlint" "--generate-summary" + else + eval "stack" "$stack_yaml_flag" "run" "--" "hlint" "--generate-summary" + fi + git diff --exit-code hints.md # Run it on its own source. - eval "C_INCLUDE_PATH=$(xcrun --show-sdk-path)/usr/include/ffi" "stack" "$stack_yaml_flag" "run" "--" "src" + if [ $uname == 'Darwin' ]; then + eval "C_INCLUDE_PATH=$(xcrun --show-sdk-path)/usr/include/ffi" "stack" "$stack_yaml_flag" "run" "--" "src" + else + eval "stack" "$stack_yaml_flag" "run" "--" "src" + fi fi # --