-
Notifications
You must be signed in to change notification settings - Fork 4
118 lines (94 loc) · 3.56 KB
/
CI.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
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.6"
os:
- ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: julia-actions/setup-julia@5c9647d97b78a5debe5164e9eec09d653d29bd71
with:
version: ${{ matrix.version }}
- uses: julia-actions/cache@824243901fb567ccb490b0d0e2483ccecde46834 # v2.0.5
- name: Install dependencies
run: julia --color=yes --project -e "using Pkg; Pkg.instantiate()"
- uses: julia-actions/julia-runtest@1e03e0122a598a569004c1e26950e2547b350ec0
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@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: julia-actions/setup-julia@5c9647d97b78a5debe5164e9eec09d653d29bd71
with:
version: "1.6"
- uses: julia-actions/cache@824243901fb567ccb490b0d0e2483ccecde46834 # v2.0.5
- 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
- name: Upload versions.json as workflow artifact
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
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@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: versions
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
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