Skip to content

Commit

Permalink
start building out github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
shayne-fletcher committed Jan 28, 2024
1 parent fa89fe3 commit 80a8557
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/hlint-from-scratch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 22 additions & 5 deletions hlint-from-scratch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

# --
Expand Down

0 comments on commit 80a8557

Please sign in to comment.