try running FUSE on Windows #2487
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: runtests | |
on: | |
workflow_dispatch: | |
inputs: | |
debug: | |
type: boolean | |
required: false | |
default: false | |
bypass-cache: | |
type: boolean | |
required: false | |
default: false | |
push: | |
branches: | |
- master | |
pull_request: | |
env: | |
PTP_READ_TOKEN: ${{ secrets.PTP_READ_TOKEN }} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: Julia ${{ matrix.flavor.version }} - ${{ matrix.flavor.os }} - ${{ matrix.flavor.arch }} | |
runs-on: ${{ matrix.flavor.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
flavor: | |
- { os: ubuntu-latest, arch: x64, version: "1.x" } | |
- { os: macos-latest, arch: arm64, version: "1.x" } | |
- { os: windows-latest, arch: x86, version: "1.x" } | |
env: | |
GKSwstype: 100 # disable Plots.jl interactive output | |
steps: | |
- name: Get number of CPU cores | |
uses: SimenB/github-actions-cpu-cores@v1 | |
id: cpu-cores | |
- name: Set JULIA_NUM_THREADS=${{ steps.cpu-cores.outputs.count }} | |
run: echo "JULIA_NUM_THREADS=${{ steps.cpu-cores.outputs.count }}" >> $GITHUB_ENV | |
- uses: actions/checkout@v2 | |
- name: Check if fuse bot commit on macOS/Linux | |
if: matrix.flavor.os != 'windows-latest' | |
run: | | |
author=$(git log -1 --pretty=format:'%an') | |
if [ "$author" = "fuse bot" ]; then | |
echo "Skipping action due to commit made by 'fuse bot'." | |
exit 78 | |
fi | |
- name: Check if fuse bot commit on Windows | |
if: matrix.flavor.os == 'windows-latest' | |
shell: pwsh | |
run: | | |
$author = git log -1 --pretty=format:'%an' | |
if ($author -eq 'fuse bot') { | |
Write-Host "Skipping action due to commit made by 'fuse bot'." | |
exit 78 | |
} | |
- uses: julia-actions/setup-julia@v1 | |
with: | |
version: ${{ matrix.flavor.version }} | |
arch: ${{ matrix.flavor.arch }} | |
show-versioninfo: true | |
- name: Generate cache key with date | |
id: cache-date | |
run: echo "::set-output name=date::$(date +%Y-%m-%d)" | |
- name: Cache Julia artifacts | |
uses: actions/cache@v2 | |
if: github.event.inputs.bypass-cache != 'true' | |
with: | |
path: | | |
~/.julia/artifacts | |
~/.julia/packages | |
~/.julia/compiled | |
key: ${{ runner.os }}-julia-${{ matrix.flavor.version }}-${{ matrix.flavor.os }}-${{ matrix.flavor.arch }}-${{ steps.cache-date.outputs.date }} | |
- name: Remove FuseRegistry and Replace git@github.com with https on macOS | |
if: matrix.flavor.os == 'macos-latest' | |
run: | | |
rm -rf ~/.julia/registries/FuseRegistry | |
echo "Replacing git@github.com with https in Package.toml files..." | |
find ~/.julia/registries/FuseRegistry -type f -name 'Package.toml' -exec sed -i '' 's|git@github.com:|https://project-torrey-pines:${{secrets.PTP_READ_TOKEN}}@github.com/|g' {} + | |
- name: Remove FuseRegistry and Replace git@github.com with https on Linux | |
if: matrix.flavor.os == 'ubuntu-latest' | |
run: | | |
rm -rf ~/.julia/registries/FuseRegistry | |
echo "Replacing git@github.com with https in Package.toml files..." | |
find ~/.julia/registries/FuseRegistry -type f -name 'Package.toml' -exec sed -i 's|git@github.com:|https://project-torrey-pines:${{secrets.PTP_READ_TOKEN}}@github.com/|g' {} + | |
- name: Remove FuseRegistry and Replace git@github.com with https on Windows | |
if: matrix.flavor.os == 'windows-latest' | |
shell: pwsh | |
run: | | |
Remove-Item -Recurse -Force "$env:USERPROFILE\.julia\registries\FuseRegistry" | |
Write-Host "Replacing git@github.com with https in Package.toml files..." | |
Get-ChildItem -Path "$env:USERPROFILE\.julia\registries\FuseRegistry" -Recurse -Filter 'Package.toml' | ForEach-Object { | |
(Get-Content $_.FullName) -replace 'git@github.com:', 'https://project-torrey-pines:${{secrets.PTP_READ_TOKEN}}@github.com/' | Set-Content $_.FullName | |
} | |
- run: make install_ci_add | |
- name: 'Save Manifest.toml' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Manifest-${{ matrix.flavor.os }}-${{ matrix.flavor.arch }} | |
path: Manifest.toml | |
- uses: julia-actions/julia-buildpkg@v1 | |
- uses: julia-actions/julia-runtest@v1 | |
- name: Debug with tmate if failure + manual trigger + debug mode | |
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug }} | |
uses: mxschmitt/action-tmate@v3 | |
timeout-minutes: 120 |