Skip to content

Commit 9f06959

Browse files
DilumAluthgecodex
andcommitted
Start with the old versions.json, instead of starting from scratch
🤖 Some parts written by Codex. Co-authored-by: OpenAI Codex GPT-5 <codex@openai.com>
1 parent 37e40a2 commit 9f06959

16 files changed

Lines changed: 2108 additions & 1369 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/node/"
12+
schedule:
13+
interval: "monthly"
14+
open-pull-requests-limit: 100

.github/workflows/CI.yml

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -26,67 +26,61 @@ 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+
- '1.10' # currently the LTS
3936
steps:
4037
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
41-
4238
- uses: julia-actions/setup-julia@4a12c5f801ca5ef0458bba44687563ef276522dd # v3.0.0
39+
with:
40+
persist-credentials: false
4341
with:
4442
version: ${{ matrix.version }}
45-
4643
- uses: julia-actions/cache@9a93c5fb3e9c1c20b60fc80a478cae53e38618a4 # v3.0.2
47-
4844
- name: Install dependencies
4945
run: julia --color=yes --project -e "using Pkg; Pkg.instantiate()"
50-
5146
- uses: julia-actions/julia-runtest@d60b785c6f2bdf4ebfb18b2b6f7d93b7dfb0efe3 # v1.11.4
5247

53-
full-test:
54-
name: Full test
48+
full-build-and-test:
5549
# This job takes a long time (1+ hours).
5650
# So we intentionally skip this job on PR runs.
5751
# But we still run this job on Merge Queue jobs.
58-
if: github.event_name != 'pull_request'
52+
# if: github.event_name != 'pull_request' # TODO: Uncomment this line before merging the PR
5953
runs-on: ubuntu-latest
6054
timeout-minutes: 360
6155
strategy:
6256
fail-fast: false
63-
6457
steps:
6558
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
66-
6759
- uses: julia-actions/setup-julia@4a12c5f801ca5ef0458bba44687563ef276522dd # v3.0.0
60+
with:
61+
persist-credentials: false
6862
with:
6963
version: '1.10' # 1.10 = current LTS
70-
7164
- uses: julia-actions/cache@9a93c5fb3e9c1c20b60fc80a478cae53e38618a4 # v3.0.2
72-
7365
- name: Install dependencies
7466
run: julia --color=yes --project -e "using Pkg; Pkg.instantiate()"
75-
76-
- run: rm -f versions.json
77-
78-
- name: Build versions.json
67+
- name: Cleanup before we build
7968
run: |
80-
using VersionsJSONUtil
81-
82-
VersionsJSONUtil.main("versions.json")
83-
shell: julia --project {0}
84-
69+
make clean
70+
make nuke
71+
make purge_download_cache_dir
72+
- name: Download the old versions.json, so we can re-use it and build on top of it
73+
run: curl -LO https://julialang-s3.julialang.org/bin/versions.json
74+
- name: Build versions.json
75+
run: make build
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Used to authenticate to GitHub API to get list of tags
78+
- name: Run the post-build tests
79+
run: make test-full
80+
- name: Install NPM deps
81+
run: make _npm_ci
8582
- 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-
83+
run: make check-schema
9084
- name: Upload versions.json as workflow artifact
9185
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
9286
with:
@@ -95,31 +89,29 @@ jobs:
9589
if-no-files-found: error
9690

9791
upload-to-s3:
98-
needs: [package-tests, full-test]
92+
needs:
93+
- package-tests
94+
- full-build-and-test
9995
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
10096
runs-on: ubuntu-latest
10197
timeout-minutes: 60
102-
10398
steps:
10499
- name: Download versions.json from previous job
105100
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
106101
with:
107102
name: versions
108-
109103
- name: Configure AWS credentials
110104
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # 6.1.0
111105
with:
112106
aws-access-key-id: ${{ secrets.AWS_DEPLOY_ACCESS_KEY_ID }}
113107
aws-secret-access-key: ${{ secrets.AWS_DEPLOY_SECRET_ACCESS_KEY }}
114108
aws-region: ${{ env.aws_region }}
115-
116109
- name: Upload versions.json to S3
117110
run: aws s3 cp versions.json s3://${{ env.s3_bucket }}/bin/versions.json --acl public-read --no-progress
118-
119-
- name: Purge cache
111+
- name: Purge Fastly cache (Fastly sits in front of S3)
120112
run: curl -X PURGE https://julialang-s3.julialang.org/bin/versions.json
121113

122-
test-current-s3:
114+
test-current-s3-allowed-to-fail:
123115
# We intentionally do not make this job a "required status check" on PRs.
124116
# Because if the currently deployed `versions.json` on S3 is already broken,
125117
# then this job will fail, which would block us from merging a PR with fixes.
@@ -142,4 +134,4 @@ jobs:
142134
- name: Download the current versions.json from S3
143135
run: curl -LO https://julialang-s3.julialang.org/bin/versions.json
144136
- name: Run the post-build tests on the versions.json that we downloaded from S3
145-
run: julia --project test/more_tests.jl versions.json
137+
run: julia --project test/post_build.jl versions.json full

.gitignore

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

Makefile

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

0 commit comments

Comments
 (0)