-
Notifications
You must be signed in to change notification settings - Fork 49
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
Improved Macos CI #328
Open
maximedenes
wants to merge
9
commits into
main
Choose a base branch
from
self-hosted-macos
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.
Open
Improved Macos CI #328
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c0c9e5a
Test CI with self hosted macOS runner
maximedenes bb52551
Add labels for self-hosted.
rtetley 648abd2
Try without ARM64
rtetley 1bae21c
Trying without any labels
rtetley f415645
Trying to fix ci
rtetley 21de09a
Trying retry action
rtetley 54798ea
Fixing CI + better strategy for finding brew path
rtetley 07084e4
Renaming yaml file
rtetley d70e167
Add github hosted runners
rtetley 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 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 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 |
---|---|---|
@@ -0,0 +1,190 @@ | ||
# Main doc: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/introduction-to-github-actions | ||
# Runners spec: https://docs.github.com/en/free-pro-team@latest/actions/reference/specifications-for-github-hosted-runners | ||
# Glob expressions: https://github.com/actions/toolkit/tree/main/packages/glob | ||
|
||
name: Macos | ||
|
||
############################################################################### | ||
# Schedule: | ||
# - push on any branch whose name matches v** or master | ||
# - any pull request | ||
############################################################################### | ||
on: | ||
push: | ||
branches: | ||
- 2021.02 | ||
- 2021.09 | ||
- main | ||
pull_request: | ||
branches: | ||
- '**' | ||
schedule: | ||
- cron: "0 0 * * *" | ||
workflow_dispatch: | ||
inputs: | ||
platform: | ||
description: 'Arguments for the platform script:' | ||
required: true | ||
default: '-extent=x -parallel=p -jobs=2 -large=e -compcert=y -set-switch=y' | ||
|
||
############################################################################### | ||
# Platform script options shared among all jobs | ||
############################################################################### | ||
env: | ||
PLATFORM_ARGS: -extent=x -parallel=p -jobs=2 -large=e -compcert=y -set-switch=y | ||
COQREGTESTING: y | ||
HOMEBREW_NO_INSTALL_FROM_API: | ||
# See https://github.com/orgs/Homebrew/discussions/4612#discussioncomment-6351357 | ||
|
||
############################################################################### | ||
# Macos | ||
# | ||
# CAVEATS: | ||
# - COQREGTESTING broken, it makes the script loop, so we install opam by hand | ||
############################################################################### | ||
jobs: | ||
Macos_platform: | ||
name: Macos | ||
runs-on: macos-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
variant: | ||
# Keep this in sync with the Smoke test below | ||
- '8.18~2023.11' | ||
- '8.18~mc2~2023.11' | ||
- '8.17~2023.08' | ||
|
||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set PLATFORM | ||
if: ${{ github.event.inputs.platform != '' }} | ||
run: echo "PLATFORM=${{ github.event.inputs.platform }}" >> $GITHUB_ENV | ||
|
||
- name: Cleanup, update and upgrade HomeBrew | ||
# This is to avoid errors of these kinds: | ||
# - ==> Downloading https://ghcr.io/v2/homebrew/core/harfbuzz/manifests/5.1.0 | ||
# Error: adwaita-icon-theme: Failed to download resource "harfbuzz_bottle_manifest" | ||
# The downloaded GitHub Packages manifest was corrupted or modified (it is not valid JSON): | ||
# - dyld[45184]: Library not loaded: '/usr/local/opt/libunistring/lib/libunistring.2.dylib' | ||
# Referenced from: '/usr/local/Cellar/wget/1.21.3/bin/wget' | ||
# Reason: tried: '/usr/local/opt/libunistring/lib/libunistring.2.dylib' (no such file), | ||
run: | | ||
brew cleanup | ||
# See https://github.com/orgs/Homebrew/discussions/4612#discussioncomment-6351357 | ||
brew config | ||
# Trying to avoid Error: No available tap homebrew/core or homebrew/cask. | ||
brew tap --force homebrew/cask | ||
brew tap --force homebrew/core | ||
brew untap homebrew/core homebrew/cask | ||
brew config | ||
brew update | ||
# Note: brew upgrade does fail regularly, but brew is anyway in a better state afterwards | ||
brew upgrade || true | ||
|
||
- name: Install homebrew packages required by main script | ||
run: brew install wget | ||
|
||
- name: Run common platform script | ||
shell: bash | ||
run: ./coq_platform_make.sh -packages=${{matrix.variant}} $PLATFORM_ARGS -dumplogs | ||
|
||
- name: Install bash (needed by smoke scripts) | ||
run: brew install bash | ||
|
||
- name: Create smoke test kit | ||
shell: bash | ||
run: | | ||
eval $(opam env) | ||
export MACOSX_DEPLOYMENT_TARGET=10.13 | ||
shell_scripts/create_smoke_test_kit.sh | ||
|
||
- name: 'Upload smoke test kit' | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: 'Smoke Test Kit Macos ${{matrix.variant}}' | ||
path: smoke-test-kit/ | ||
retention-days: 5 | ||
|
||
- name: Install findutils, coreutils and macpack (needed by DMG script) | ||
run: | | ||
brew install findutils | ||
brew install coreutils | ||
pip3 install macpack | ||
|
||
- name: 'Build DMG installer' | ||
uses: Wandalen/wretry.action@master | ||
with: | ||
attempt_limit: 5 | ||
attempt_delay: 5000 | ||
shell: bash | ||
command: | | ||
eval $(opam env) | ||
macos/create_installer_macos.sh | ||
|
||
- name: 'Upload DMG script logs on failure' | ||
uses: actions/upload-artifact@v2 | ||
if: failure() | ||
with: | ||
name: 'DMG script error logs ${{matrix.variant}}' | ||
path: macos_installer/logs/ | ||
|
||
- name: 'Upload Artifact' | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: 'Macos installer ${{matrix.variant}} x86_64' | ||
path: macos_installer/Coq-Platform-*.dmg | ||
retention-days: 5 | ||
|
||
Macos_smoke: | ||
name: Smoke test Macos | ||
needs: Macos_platform | ||
runs-on: macos-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
variant: | ||
- '8.18~2023.11' | ||
- '8.18~mc2~2023.11' | ||
- '8.17~2023.08' | ||
|
||
steps: | ||
- name: Install bash | ||
run: brew install bash | ||
|
||
- name: 'Download Artifact' | ||
uses: actions/download-artifact@v2 | ||
id: download | ||
with: | ||
name: 'Macos installer ${{matrix.variant}} x86_64' | ||
|
||
- name: 'Download smoke test kit' | ||
uses: actions/download-artifact@v2 | ||
id: download-smoke | ||
with: | ||
name: 'Smoke Test Kit Macos ${{matrix.variant}}' | ||
|
||
- name: 'Run Installer' | ||
shell: bash | ||
run: | | ||
cd ${{steps.download.outputs.download-path}} | ||
DMG=$(ls Coq-Platform-*.dmg) | ||
hdiutil attach $DMG | ||
cp -r /Volumes/${DMG%%.dmg}/Coq-Platform*.app /Applications/ | ||
hdiutil detach /Volumes/${DMG%%.dmg}/ | ||
|
||
- name: 'Smoke coqc' | ||
shell: bash | ||
run: | | ||
cd /Applications/Coq-Platform*.app/Contents/Resources/bin/ | ||
./coqc -v | ||
|
||
- name: 'Run Macos smoke test kit' | ||
shell: bash | ||
run: | | ||
export PATH="$PATH:$(cd /Applications/Coq-Platform*.app/Contents/Resources/bin/; pwd)" | ||
cd ${{steps.download-smoke.outputs.download-path}} | ||
chmod a+x ./run-smoke-test.sh | ||
./run-smoke-test.sh |
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
Oops, something went wrong.
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.
@rtetley : since my shell based fix didn't work (hdiutil somehow crashes so badly that it kills the containing shell) I tried your fix. One issue: the
shell: bash
line seems to be not supported, but I usedWandalen/wretry.action@v1
rather than@master
.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.
On this PR it seemed to work fine ? Does it only fail when it requires a retry ?
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.
It doesn't fail, it just gives a warning.
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.
Sorry, likely my bad. I thought that using abbreviated version numbers (like @v1) is a github feature, but apparently it is a feature of many github actions implemented by duplicating tags - the wretry doesn't have this. So I got some random version. I will try again wit a proper version tag.
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.
I tried it again with:
This still gives a warning:
As far as I can tell the tag
v1.3.0
is identical to master (I don't like to have master versions of actions in CI).Do you have a reference which suggests that the
shell
key is allowed? It would be useful to make this explicit, but it also works without it.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.
Ah no, unfortunately no :-/ I hadn't noticed the warning before... I also have it on this PR...