Skip to content
This repository was archived by the owner on Dec 16, 2024. It is now read-only.

Commit 3d2a927

Browse files
committed
CI: Standardize the workflow for testing and changing the UUID
1 parent 71002bc commit 3d2a927

File tree

4 files changed

+29
-17
lines changed

4 files changed

+29
-17
lines changed

.ci/change-uuid.jl

Lines changed: 0 additions & 5 deletions
This file was deleted.

.ci/test_and_change_uuid.jl

Lines changed: 28 additions & 0 deletions
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 = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"
11+
const new_uuid = "5607b0f0-06f3-5cda-b6b1-a6196a1729e9"
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+
)

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ jobs:
4545
${{ runner.os }}-test-${{ env.cache-name }}-
4646
${{ runner.os }}-test-${{ matrix.os }}
4747
${{ runner.os }}-
48-
- run: julia --color=yes test/suitesparse_uuid.jl
49-
- run: julia --color=yes .ci/change-uuid.jl
48+
- run: julia --color=yes .ci/test_and_change_uuid.jl
5049
- uses: julia-actions/julia-buildpkg@v1
5150
- uses: julia-actions/julia-runtest@v1
5251
- uses: julia-actions/julia-processcoverage@v1

test/suitesparse_uuid.jl

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)