-
-
Notifications
You must be signed in to change notification settings - Fork 6
145 lines (119 loc) · 4.91 KB
/
CI.yml
File metadata and controls
145 lines (119 loc) · 4.91 KB
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
name: CI
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- "README.md"
pull_request:
merge_group: # GitHub Merge Queue
concurrency:
# Skip intermediate builds: all builds except for builds on the `master` branch
# Cancel intermediate builds: only pull request builds
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/main' || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
permissions:
contents: read
actions: write # Needed for `julia-actions/cache` to clear old caches
env:
aws_region: us-east-1
s3_bucket: julialang2
jobs:
package-tests:
name: Package tests
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
version:
- '1.10' # 1.10 = current LTS
os:
- ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
- uses: julia-actions/setup-julia@4a12c5f801ca5ef0458bba44687563ef276522dd # v3.0.0
with:
version: ${{ matrix.version }}
- uses: julia-actions/cache@9a93c5fb3e9c1c20b60fc80a478cae53e38618a4 # v3.0.2
- name: Install dependencies
run: julia --color=yes --project -e "using Pkg; Pkg.instantiate()"
- uses: julia-actions/julia-runtest@d60b785c6f2bdf4ebfb18b2b6f7d93b7dfb0efe3 # v1.11.4
full-test:
name: Full test
# This job takes a long time (1+ hours).
# So we intentionally skip this job on PR runs.
# But we still run this job on Merge Queue jobs.
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 360
strategy:
fail-fast: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
- uses: julia-actions/setup-julia@4a12c5f801ca5ef0458bba44687563ef276522dd # v3.0.0
with:
version: '1.10' # 1.10 = current LTS
- uses: julia-actions/cache@9a93c5fb3e9c1c20b60fc80a478cae53e38618a4 # v3.0.2
- name: Install dependencies
run: julia --color=yes --project -e "using Pkg; Pkg.instantiate()"
- run: rm -f versions.json
- name: Build versions.json
run: |
using VersionsJSONUtil
VersionsJSONUtil.main("versions.json")
shell: julia --project {0}
- name: Validate versions.json against schema
run: npx -p ajv-cli@3.3.0 ajv -s schema.json -d versions.json
- run: julia --project test/more_tests.jl versions.json
- name: Upload versions.json as workflow artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: versions
path: versions.json
if-no-files-found: error
upload-to-s3:
needs: [package-tests, full-test]
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Download versions.json from previous job
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: versions
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # 6.1.0
with:
aws-access-key-id: ${{ secrets.AWS_DEPLOY_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DEPLOY_SECRET_ACCESS_KEY }}
aws-region: ${{ env.aws_region }}
- name: Upload versions.json to S3
run: aws s3 cp versions.json s3://${{ env.s3_bucket }}/bin/versions.json --acl public-read --no-progress
- name: Purge cache
run: curl -X PURGE https://julialang-s3.julialang.org/bin/versions.json
test-current-s3:
# We intentionally do not make this job a "required status check" on PRs.
# Because if the currently deployed `versions.json` on S3 is already broken,
# then this job will fail, which would block us from merging a PR with fixes.
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
with:
persist-credentials: false
- uses: julia-actions/setup-julia@4c0cb0fce8556fdb04a90347310e5db8b1f98fb9 # v2.7.0
with:
version: 'lts'
- uses: julia-actions/cache@9a93c5fb3e9c1c20b60fc80a478cae53e38618a4 # v3.0.2
- name: Install dependencies
run: julia --color=yes --project -e "using Pkg; Pkg.instantiate(); Pkg.precompile()"
- name: Remove an old versions.json if one happens to be lying around
run: rm -fv versions.json
- name: Download the current versions.json from S3
run: curl -LO https://julialang-s3.julialang.org/bin/versions.json
- name: Run the post-build tests on the versions.json that we downloaded from S3
run: julia --project test/more_tests.jl versions.json