-
Notifications
You must be signed in to change notification settings - Fork 11
89 lines (86 loc) · 2.68 KB
/
ReusableTest.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
name: Reusable test
on:
workflow_call:
inputs:
version:
required: false
type: string
default: "1"
os:
required: false
type: string
default: ubuntu-latest
arch:
required: false
type: string
default: x64
allow_failure:
required: false
type: boolean
default: false
run_codecov:
required: false
type: boolean
default: false
secrets:
codecov_token:
required: true
jobs:
test:
name: Julia ${{ inputs.version }} - ${{ inputs.os }} - ${{ inputs.arch }} - ${{ github.event_name }}
runs-on: ${{ inputs.os }}
continue-on-error: ${{ inputs.allow_failure }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
- name: Create branch main
if: github.ref != 'refs/heads/main'
run: |
git branch this-pr
git checkout origin/main
git branch --track main origin/main
git checkout this-pr
- name: Create BESTIE_SKIP_UPDATE_TEST=yes if necessary
if: github.ref != 'refs/heads/main'
shell: bash
run: |
if git --no-pager log main..HEAD | grep -q BESTIE_SKIP_UPDATE_TEST; then
echo "BESTIE_SKIP_UPDATE_TEST=yes" >> $GITHUB_ENV
fi
- uses: julia-actions/setup-julia@v2
with:
version: ${{ inputs.version }}
arch: ${{ inputs.arch }}
- name: Use Julia cache
uses: julia-actions/cache@v2
- name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807
run: touch requirements.txt
- name: Setup Python
uses: actions/setup-python@v5
with:
cache: "pip"
python-version: "3.11"
- name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807
run: rm requirements.txt
- name: Cache pre-commit
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
- name: Install pre-commit
run: pip install pre-commit
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
TMPDIR: "${{ runner.temp }}"
- uses: julia-actions/julia-processcoverage@v1
if: ${{ inputs.run_codecov }}
- uses: codecov/codecov-action@v4
if: ${{ inputs.run_codecov }}
with:
file: lcov.info
token: ${{ secrets.codecov_token }}