-
Notifications
You must be signed in to change notification settings - Fork 4
135 lines (111 loc) · 4.13 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
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
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@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- uses: julia-actions/setup-julia@a0a0978e28861c11a3490cee468f87d5b568851a
with:
version: ${{ matrix.version }}
- uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- name: Install dependencies
run: julia --color=yes --project -e "using Pkg; Pkg.instantiate()"
- uses: julia-actions/julia-runtest@d0c4f093badade621cd041bba567d1e832480ac2
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@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- uses: julia-actions/setup-julia@a0a0978e28861c11a3490cee468f87d5b568851a
with:
version: "1.6"
- uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- 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@c24449f33cd45d4826c6702db7e49f7cdb9b551d
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@0d9a5be0dceea74e09396820e1e522ba4a110d2f
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