-
-
Notifications
You must be signed in to change notification settings - Fork 67
43 lines (39 loc) · 1.51 KB
/
CustomCommands.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
name: Custom Commands
on:
pull_request:
jobs:
custom_actions:
runs-on: ubuntu-latest
steps:
- name: Wait for commands
id: read_commands
run: |
ci_commands=$(curl -sH "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X GET "${{ github.event.pull_request.comments_url }}" | jq -r ".[] | select(.body | startswith(\"/run-actions\")) | .body")
if [ ! -z "$ci_commands" ]; then
echo "Read commands $ci_commands"
echo "ci_commands=$ci_commands" >> $GITHUB_OUTPUT
break
fi
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1.9'
arch: 'x64'
- name: Run provided commands
run: |
echo "Got custom commands:"
ci_commands="${{ steps.read_commands.outputs.ci_commands }}"
echo $ci_commands
if echo "$ci_commands" | grep -q benchmark; then
echo "Running benchmarks..."
julia -e 'using Pkg; Pkg.add("BenchmarkTools"); Pkg.develop(;path=pwd())'
JULIA_PROJECT=$PWD julia --project benchmarks/benchmark.jl
fi
if echo "$ci_commands" | grep -q premerge; then
echo "Running pre-merge checks..."
julia -e 'using Pkg; Pkg.add("Aqua"); Pkg.develop(;path=pwd())'
JULIA_PROJECT=$PWD julia --project -e 'using Aqua, Dagger; Aqua.test_all(Dagger)'
fi
env:
BENCHMARK: "nmf:raw,dagger"
BENCHMARK_SCALE: "5:5:10"