Skip to content

Commit ca8e02f

Browse files
DilumAluthgecodex
andcommitted
Start with the old versions.json, instead of starting from scratch
🤖 Some small parts written by Codex. Co-authored-by: Codex <codex@openai.com>
1 parent 7fb20f6 commit ca8e02f

15 files changed

Lines changed: 2769 additions & 217 deletions

.github/dependabot.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
version: 2
22
updates:
3+
34
- package-ecosystem: "github-actions"
45
directory: "/"
56
schedule:
67
interval: "monthly"
78
open-pull-requests-limit: 100
8-
labels:
9-
- "dependencies"
10-
- "github-actions"
9+
10+
- package-ecosystem: "npm"
11+
directory: "/test/"
12+
schedule:
13+
interval: "monthly"
14+
open-pull-requests-limit: 100

.github/workflows/CI.yml

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,32 +26,27 @@ env:
2626

2727
jobs:
2828
package-tests:
29-
name: Package tests
30-
runs-on: ${{ matrix.os }}
29+
runs-on: ubuntu-latest
3130
timeout-minutes: 60
3231
strategy:
3332
fail-fast: false
3433
matrix:
3534
version:
36-
- '1.10' # 1.10 = current LTS
37-
os:
38-
- ubuntu-latest
35+
- 'lts'
36+
- '1'
3937
steps:
4038
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
41-
39+
with:
40+
persist-credentials: false
4241
- uses: julia-actions/setup-julia@4c0cb0fce8556fdb04a90347310e5db8b1f98fb9 # v2.7.0
4342
with:
4443
version: ${{ matrix.version }}
45-
4644
- uses: julia-actions/cache@9a93c5fb3e9c1c20b60fc80a478cae53e38618a4 # v3.0.2
47-
4845
- name: Install dependencies
4946
run: julia --color=yes --project -e "using Pkg; Pkg.instantiate()"
50-
5147
- uses: julia-actions/julia-runtest@d60b785c6f2bdf4ebfb18b2b6f7d93b7dfb0efe3 # v1.11.4
5248

53-
full-test:
54-
name: Full test
49+
full-build-and-test:
5550
# This job takes a long time (1+ hours).
5651
# So we intentionally skip this job on PR runs.
5752
# But we still run this job on Merge Queue jobs.
@@ -60,33 +55,33 @@ jobs:
6055
timeout-minutes: 360
6156
strategy:
6257
fail-fast: false
63-
6458
steps:
6559
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
66-
60+
with:
61+
persist-credentials: false
6762
- uses: julia-actions/setup-julia@4c0cb0fce8556fdb04a90347310e5db8b1f98fb9 # v2.7.0
6863
with:
6964
version: '1.10' # 1.10 = current LTS
70-
7165
- uses: julia-actions/cache@9a93c5fb3e9c1c20b60fc80a478cae53e38618a4 # v3.0.2
72-
7366
- name: Install dependencies
7467
run: julia --color=yes --project -e "using Pkg; Pkg.instantiate()"
75-
76-
- run: rm -f versions.json
77-
68+
- name: Cleanup before we build
69+
run:
70+
rm -fv versions.json
71+
make nuke
72+
make purge_download_cache_dir
73+
- name: Download the old versions.json, so we can re-use it
74+
run: curl -LO https://julialang-s3.julialang.org/bin/versions.json
7875
- name: Build versions.json
79-
run: |
80-
using VersionsJSONUtil
81-
82-
VersionsJSONUtil.main("versions.json")
83-
shell: julia --project {0}
84-
76+
run: make versions.json
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
- name: Run the post-build tests
80+
run: julia --project test/post_build.jl versions.json
81+
- name: Install NPM deps
82+
run: make _npm_ci
8583
- name: Validate versions.json against schema
86-
run: npx -p ajv-cli@3.3.0 ajv -s schema.json -d versions.json
87-
88-
- run: julia --project test/more_tests.jl versions.json
89-
84+
run: make check-schema
9085
- name: Upload versions.json as workflow artifact
9186
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
9287
with:
@@ -95,7 +90,9 @@ jobs:
9590
if-no-files-found: error
9691

9792
upload-to-s3:
98-
needs: [package-tests, full-test]
93+
needs:
94+
- package-tests
95+
- full-build-and-test
9996
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
10097
runs-on: ubuntu-latest
10198
timeout-minutes: 60
@@ -105,16 +102,13 @@ jobs:
105102
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
106103
with:
107104
name: versions
108-
109105
- name: Configure AWS credentials
110106
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # 6.0.0
111107
with:
112108
aws-access-key-id: ${{ secrets.AWS_DEPLOY_ACCESS_KEY_ID }}
113109
aws-secret-access-key: ${{ secrets.AWS_DEPLOY_SECRET_ACCESS_KEY }}
114110
aws-region: ${{ env.aws_region }}
115-
116111
- name: Upload versions.json to S3
117112
run: aws s3 cp versions.json s3://${{ env.s3_bucket }}/bin/versions.json --acl public-read --no-progress
118-
119113
- name: Purge cache
120114
run: curl -X PURGE https://julialang-s3.julialang.org/bin/versions.json

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1+
# Directories:
2+
cache/
3+
node_modules/
4+
5+
6+
# Files:
7+
internal.json
18
versions.json

Makefile

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Usage:
2+
# make build
3+
# make test
4+
5+
JULIA ?= julia +1.10
6+
7+
# This is the default target:
8+
# It's a phony target because you might want to re-build versions.json even if none of the
9+
# files in this repo have changed.
10+
.PHONY: build
11+
build: _instantiate
12+
JULIA_LOAD_PATH='@' $(JULIA) --startup-file=no --project -e 'import VersionsJSONUtil; VersionsJSONUtil.main(".")'
13+
14+
# These are the post-build tests:
15+
.PHONY: test
16+
test: test-full
17+
18+
.PHONY: test-full
19+
test-full: _instantiate
20+
JULIA_LOAD_PATH='@:@stdlib' $(JULIA) --startup-file=no --project test/post_build.jl versions.json full
21+
22+
.PHONY: test-partial
23+
test-partial: _instantiate
24+
JULIA_LOAD_PATH='@:@stdlib' $(JULIA) --startup-file=no --project test/post_build.jl versions.json partial
25+
26+
.PHONY: check-schema
27+
check-schema:
28+
(cd test/node && npx ajv -s ../../schema.json -d ../../versions.json)
29+
30+
# ------------------------------------------------------------------------------------------
31+
32+
.PHONY: _instantiate
33+
_instantiate:
34+
JULIA_LOAD_PATH='@:@stdlib' $(JULIA) --startup-file=no --project -e 'import Pkg; Pkg.instantiate(); Pkg.precompile()'
35+
36+
.PHONY: _npm_ci
37+
_npm_ci:
38+
(cd test/node && npm ci)
39+
40+
41+
.PHONY: clean
42+
clean:
43+
$(RM) -v internal.json
44+
45+
.PHONY: nuke
46+
nuke:
47+
$(RM) -v internal.json
48+
$(RM) -v versions.json
49+
50+
.PHONY: purge_download_cache_dir
51+
purge_download_cache_dir:
52+
$(RM) -r cache/

0 commit comments

Comments
 (0)