-
Notifications
You must be signed in to change notification settings - Fork 3
149 lines (128 loc) · 5.5 KB
/
runtests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: runtests
on:
workflow_dispatch:
inputs:
debug:
type: boolean
required: false
default: false
bypass-cache:
type: boolean
required: false
default: false
run_fuse_with_extensions:
type: boolean
required: false
default: false
push:
branches:
- master
- dev
pull_request:
schedule:
- cron: '7 0 * * *' # midnight PT
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: Check if Scheduled Run
id: is-scheduled
run: |
if [ "${{ github.event_name }}" == "schedule" ] || [ "${{ github.event.inputs.run_fuse_with_extensions }}" == "true" ]; then
echo "FUSE_WITH_EXTENSIONS=true" >> $GITHUB_ENV
else
echo "FUSE_WITH_EXTENSIONS=false" >> $GITHUB_ENV
fi
- name: Display Run Type
run: echo "Is this a FUSE_WITH_EXTENSIONS run? ${{ env.FUSE_WITH_EXTENSIONS }}"
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
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@v4
# Julia setup
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.flavor.version }}
arch: ${{ matrix.flavor.arch }}
show-versioninfo: true
# Cache key generation
- name: Generate cache key with date
id: cache-date
run: echo "{date}=$(date +%Y-%m-%d)" >> $GITHUB_STATE
# Cache Julia artifacts
- name: Cache Julia artifacts
uses: actions/cache@v4
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 }}
# FuseRegistry management on macOS
- name: Remove FuseRegistry and Add Registry on macOS
if: matrix.flavor.os == 'macos-latest'
run: |
rm -rf ~/.julia/registries/FuseRegistry
julia -e 'using Pkg; Pkg.Registry.add(RegistrySpec(url="https://github.com/ProjectTorreyPines/FuseRegistry.jl.git")); Pkg.Registry.add("General"); Pkg.Registry.update()'
find ~/.julia/registries/FuseRegistry -type f -name 'Package.toml' -exec sed -i '' 's|[email protected]:|https://project-torrey-pines:${{secrets.PTP_READ_TOKEN}}@github.com/|g' {} +
# FuseRegistry management on Linux
- name: Remove FuseRegistry and Add Registry on Linux
if: matrix.flavor.os == 'ubuntu-latest'
run: |
rm -rf ~/.julia/registries/FuseRegistry
julia -e 'using Pkg; Pkg.Registry.add(RegistrySpec(url="https://github.com/ProjectTorreyPines/FuseRegistry.jl.git")); Pkg.Registry.add("General"); Pkg.Registry.update()'
find ~/.julia/registries/FuseRegistry -type f -name 'Package.toml' -exec sed -i 's|[email protected]:|https://project-torrey-pines:${{secrets.PTP_READ_TOKEN}}@github.com/|g' {} +
# FuseRegistry management on Windows
- name: Remove FuseRegistry and Add Registry on Windows
if: matrix.flavor.os == 'windows-latest'
shell: pwsh
run: |
if (Test-Path "$env:USERPROFILE\.julia\registries\FuseRegistry") {
Write-Host "Removing FuseRegistry directory..."
Remove-Item -Recurse -Force "$env:USERPROFILE\.julia\registries\FuseRegistry"
} else {
Write-Host "Directory does not exist, skipping removal."
}
julia -e 'using Pkg; Pkg.Registry.add(RegistrySpec(url="https://github.com/ProjectTorreyPines/FuseRegistry.jl.git")); Pkg.Registry.add("General"); Pkg.Registry.update()'
Get-ChildItem -Path "$env:USERPROFILE\.julia\registries\FuseRegistry" -Recurse -Filter 'Package.toml' | ForEach-Object {
(Get-Content $_.FullName) -replace '[email protected]:', 'https://project-torrey-pines:${{secrets.PTP_READ_TOKEN}}@github.com/' | Set-Content $_.FullName
}
- name: 'Install (without extensions)'
if: env.FUSE_WITH_EXTENSIONS == 'false'
run: make install_ci_add NO_FUSE_EXTENSION=true
- name: 'Install (with extensions)'
if: env.FUSE_WITH_EXTENSIONS == 'true'
run: make install_ci_add
# Save Manifest.toml
- name: 'Save Manifest.toml'
uses: actions/upload-artifact@v4
with:
name: Manifest-${{ matrix.flavor.os }}-${{ matrix.flavor.arch }}
path: Manifest.toml
# Build
- uses: julia-actions/julia-buildpkg@v1
# Run tests
- uses: julia-actions/julia-runtest@v1
# Code coverage
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v5
with:
files: lcov.info