Skip to content

Commit 40b7255

Browse files
DilumAluthgeericphanson
authored andcommitted
CI: Standardize the workflow for testing and changing the UUID (JuliaLang#129)
(cherry picked from commit cd002c3)
1 parent 45acb38 commit 40b7255

File tree

4 files changed

+29
-17
lines changed

4 files changed

+29
-17
lines changed

.ci/change_uuid.jl

-5
This file was deleted.

.ci/test_and_change_uuid.jl

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
@static if Base.VERSION >= v"1.6"
2+
using TOML
3+
using Test
4+
else
5+
using Pkg: TOML
6+
using Test
7+
end
8+
9+
# To generate the new UUID, we simply modify the first character of the original UUID
10+
const original_uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
11+
const new_uuid = "e43a241f-c20a-4ad4-852c-f6b1247861c6"
12+
13+
# `@__DIR__` is the `.ci/` folder.
14+
# Therefore, `dirname(@__DIR__)` is the repository root.
15+
const project_filename = joinpath(dirname(@__DIR__), "Project.toml")
16+
17+
@testset "Test that the UUID is unchanged" begin
18+
project_dict = TOML.parsefile(project_filename)
19+
@test project_dict["uuid"] == original_uuid
20+
end
21+
22+
write(
23+
project_filename,
24+
replace(
25+
read(project_filename, String),
26+
r"uuid = .*?\n" => "uuid = \"$(new_uuid)\"\n",
27+
),
28+
)

.ci/test_uuid_is_unchanged.jl

-10
This file was deleted.

.github/workflows/ci.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ jobs:
4747
${{ runner.os }}-test-${{ env.cache-name }}-
4848
${{ runner.os }}-test-${{ matrix.os }}
4949
${{ runner.os }}-
50-
- run: julia --color=yes .ci/test_uuid_is_unchanged.jl
51-
- run: julia --color=yes .ci/change_uuid.jl
50+
- run: julia --color=yes .ci/test_and_change_uuid.jl
5251
- uses: julia-actions/julia-buildpkg@v1
5352
- uses: julia-actions/julia-runtest@v1
5453
- uses: julia-actions/julia-processcoverage@v1

0 commit comments

Comments
 (0)