Bump actions/checkout from 3 to 4 #35
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
name: CI | |
on: | |
pull_request: | |
push: | |
branches: main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
label: | |
- lts | |
- custom | |
include: | |
- label: lts | |
working-directory: test/lts-example | |
expected-current: lts-20.20 | |
- label: custom | |
working-directory: test/custom-repo-example | |
expected-current: https://raw.githubusercontent.com/freckle/stackage-snapshots/main/lts/20/20.yaml | |
github-repo: freckle/stackage-snapshots | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run action on stack.yaml resolving to LTS Haskell snapshot | |
id: test | |
uses: ./ | |
with: | |
working-directory: ${{ matrix.working-directory }} | |
github-repo: ${{ matrix.github-repo }} | |
- name: Validate action outputs | |
run: | | |
expected_current=${{ matrix.expected-current }} | |
current=${{ steps.test.outputs.current }} | |
latest=${{ steps.test.outputs.latest }} | |
newer_available=${{ steps.test.outputs.newer-available }} | |
build_errors=${{ steps.test.outputs.build-errors }} | |
commit_message="${{ steps.test.outputs.commit-message }}" | |
if [[ "$current" != "$expected_current" ]]; then | |
echo "Found unexpected current LTS version:" | |
echo "$current" | |
exit 1 | |
fi | |
if [[ -z "$latest" ]]; then | |
echo "Action failed to find latest LTS version" | |
exit 1 | |
fi | |
if [[ "$newer_available" != "true" ]]; then | |
echo "Failed to find newer resolver" | |
exit 1 | |
fi | |
if [[ "$build_errors" == "true" ]]; then | |
echo "Failed to build with updated resolver" | |
exit 1 | |
fi | |
if ! echo "$commit_message" | grep -q "Bump Stackage Resolver to" ; then | |
echo "Malformed commit message:" | |
echo "$commit_message" | |
exit 1 | |
fi |