-
Notifications
You must be signed in to change notification settings - Fork 4
Upgrade GitHub Actions to latest versions #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
8
commits into
main
Choose a base branch
from
copilot/fix-37a0379b-1a0c-4996-8923-e15698cc5e21
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+49
−68
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6a5243c
Initial plan
Copilot 0741ce0
Upgrade GitHub Actions to latest versions
Copilot 93643ae
Replace cancel-workflow-action with concurrency group
Copilot 91c6897
Replace manual GHC installation with haskell-actions/setup@v2
Copilot 931aa0a
Use ormolu action
cprecioso c0c3a7c
Format with latest ormolu
cprecioso da554fc
Do not fail-fast
cprecioso 8a535f3
Set macos-13
cprecioso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,36 +5,33 @@ on: | |||||
pull_request: { branches: [main] } | ||||||
create: { tags: [v*] } | ||||||
|
||||||
concurrency: | ||||||
group: ${{ github.workflow }}-${{ github.ref }} | ||||||
cancel-in-progress: true | ||||||
|
||||||
defaults: | ||||||
run: | ||||||
shell: bash | ||||||
|
||||||
jobs: | ||||||
cancel: | ||||||
name: Cancel redundant actions already in progress | ||||||
runs-on: ubuntu-latest | ||||||
steps: | ||||||
- name: Cancel actions in progress of same workflow and same branch | ||||||
uses: styfle/[email protected] | ||||||
with: | ||||||
access_token: ${{ github.token }} | ||||||
|
||||||
# Check that Haskell code is formatted. | ||||||
code-formatter: | ||||||
runs-on: ubuntu-latest | ||||||
steps: | ||||||
- uses: actions/checkout@v2 | ||||||
- uses: mrkkrp/ormolu-action@v2 | ||||||
- uses: actions/checkout@v4 | ||||||
- uses: haskell-actions/run-ormolu@v17 | ||||||
|
||||||
build: | ||||||
name: Build StrongPath | ||||||
runs-on: ${{ matrix.os }} | ||||||
needs: code-formatter | ||||||
|
||||||
strategy: | ||||||
fail-fast: false | ||||||
matrix: | ||||||
os: | ||||||
- ubuntu-latest | ||||||
- macos-latest | ||||||
# macos-latest is only ARM, when we update to a newer haskell we can run on it | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
- macos-13 | ||||||
- windows-latest | ||||||
stack-resolver: | ||||||
- from-stack-yaml | ||||||
|
@@ -48,10 +45,10 @@ jobs: | |||||
|
||||||
steps: | ||||||
- name: Checkout the repo | ||||||
uses: actions/checkout@v2 | ||||||
uses: actions/checkout@v4 | ||||||
|
||||||
- name: Cache (Unix) | ||||||
uses: actions/cache@v2 | ||||||
uses: actions/cache@v4 | ||||||
if: runner.os == 'Linux' || runner.os == 'macOS' | ||||||
with: | ||||||
path: | | ||||||
|
@@ -73,11 +70,13 @@ jobs: | |||||
# making it even slower to test and fix (uffff). | ||||||
# When they fix this, we should remove ${{ github.run_id }} from the end of the key | ||||||
# and also remove restore-keys. | ||||||
key: haskell-${{ runner.os }}-${{ hashFiles('stack.yaml') }}-${{ github.run_id }} | ||||||
key: | ||||||
haskell-${{ runner.os }}-${{ hashFiles('stack.yaml') }}-${{ | ||||||
github.run_id }} | ||||||
restore-keys: | | ||||||
haskell-${{ runner.os }}-${{ hashFiles('stack.yaml') }}- | ||||||
- name: Cache (Windows) | ||||||
uses: actions/cache@v2 | ||||||
uses: actions/cache@v4 | ||||||
if: runner.os == 'Windows' | ||||||
with: | ||||||
# C\:sr is where stack installs compiled dependencies. | ||||||
|
@@ -87,40 +86,22 @@ jobs: | |||||
path: | | ||||||
C:\sr | ||||||
# TODO: Check TODO in caching for Unix above. | ||||||
key: haskell-${{ runner.os }}-${{ hashFiles('stack.yaml') }}-${{ github.run_id }} | ||||||
key: | ||||||
haskell-${{ runner.os }}-${{ hashFiles('stack.yaml') }}-${{ | ||||||
github.run_id }} | ||||||
restore-keys: | | ||||||
haskell-${{ runner.os }}-${{ hashFiles('stack.yaml') }}- | ||||||
# TODO: Remove this step once https://github.com/actions/cache/issues/445 is resolved. | ||||||
- name: Fix MacOS problem with corrupt cached executable | ||||||
if: runner.os == 'macOS' | ||||||
run: rm -rf ~/.stack/setup-exe-cache | ||||||
|
||||||
# We are setting up haskell via ghcup instead of using haskell/actions/setup | ||||||
# because the mentioned gh action can be months late with the latest versions | ||||||
# of Stack. | ||||||
Comment on lines
-98
to
-100
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this reason not valid anymore? Of the action in question easily being late for months with the latest version of Stack? |
||||||
- name: Set up Haskell (Stack) via ghcup (Unix) | ||||||
if: runner.os == 'Linux' || runner.os == 'macOS' | ||||||
run: | | ||||||
export BOOTSTRAP_HASKELL_NONINTERACTIVE=1 | ||||||
export BOOTSTRAP_HASKELL_INSTALL_STACK=1 | ||||||
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh | ||||||
|
||||||
- name: Set up Haskell (Stack) via ghcup (Win) | ||||||
if: runner.os == 'Windows' | ||||||
run: | | ||||||
Set-ExecutionPolicy Bypass -Scope Process -Force | ||||||
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 | ||||||
Invoke-Command -ScriptBlock ([ScriptBlock]::Create(".{$(Invoke-WebRequest https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing)} -InstallStack")) | ||||||
shell: powershell | ||||||
|
||||||
# NOTE: I commented out this in favor of manual setup above, since with this action we | ||||||
# couldn't get the latest version of Stack. | ||||||
# - name: Set up Haskell (Stack) | ||||||
# uses: haskell/actions/setup@v1 | ||||||
# with: | ||||||
# ghc-version: latest | ||||||
# enable-stack: true | ||||||
# stack-version: latest | ||||||
- name: Set up Haskell | ||||||
uses: haskell-actions/setup@v2 | ||||||
with: | ||||||
ghc-version: latest | ||||||
enable-stack: true | ||||||
stack-version: latest | ||||||
|
||||||
- name: Set Stack resolver | ||||||
if: matrix.stack-resolver != 'from-stack-yaml' | ||||||
|
@@ -134,10 +115,10 @@ jobs: | |||||
stack path --stack-root | ||||||
stack ghc -- --version | ||||||
ghc --version | ||||||
- name: Build dependencies | ||||||
|
||||||
- name: Build dependencies | ||||||
run: stack --install-ghc test --only-dependencies | ||||||
|
||||||
- name: Build StrongPath & Run tests | ||||||
run: stack test | ||||||
|
||||||
|
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is it that we dropped this line? Was it never needed?