Skip to content

Commit 266b41e

Browse files
committed
use justfile in actions
1 parent cf864ac commit 266b41e

3 files changed

Lines changed: 84 additions & 86 deletions

File tree

.github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
build:
1111
runs-on: windows-latest
1212
steps:
13-
- uses: actions/checkout@v1
13+
- uses: actions/checkout@v4
1414
name: Checkout Code
1515

1616
- name: Setup .NET

.github/workflows/linux-build.yml

Lines changed: 63 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,63 @@
1-
name: linux-build
2-
3-
on:
4-
workflow_call:
5-
outputs:
6-
artifact-name:
7-
description: "Linux bits"
8-
value: linux-bits
9-
10-
jobs:
11-
build:
12-
runs-on: ubuntu-latest
13-
14-
steps:
15-
- uses: actions/checkout@v1
16-
name: Checkout Code
17-
18-
# Necessary for running neato
19-
- name: Install libgts
20-
run: sudo apt-get update && sudo apt-get install -y libgts-0.7-5
21-
22-
- name: Setup .NET
23-
uses: actions/setup-dotnet@v3
24-
with:
25-
dotnet-version: 8.0.x
26-
27-
- name: Restore Tools
28-
run: dotnet tool restore
29-
30-
- name: Restore NuGet Packages
31-
run: dotnet restore Rubjerg.Graphviz.sln
32-
33-
- name: Print PWD
34-
run: pwd
35-
36-
- name: Build App
37-
run: dotnet build Rubjerg.Graphviz.sln --configuration Release --no-restore
38-
39-
- name: Build App Another Time because dot net sucks and cannot see the native dependencies the first time
40-
run: dotnet build Rubjerg.Graphviz.sln --configuration Release --no-restore
41-
42-
- name: Debug Intermediate Output
43-
run: ls -la /home/runner/work/Graphviz.NetWrapper/Graphviz.NetWrapper/Rubjerg.Graphviz/Resources
44-
45-
- name: Debug Build Output
46-
run: ls -la /home/runner/work/Graphviz.NetWrapper/Graphviz.NetWrapper/Rubjerg.Graphviz/bin/x64/Release/netstandard2.0/
47-
48-
- name: Restore (just built) NuGet Packages for Tests
49-
run: dotnet restore Rubjerg.Graphviz.Tests.sln
50-
51-
- name: Build Tests
52-
run: dotnet build Rubjerg.Graphviz.Tests.sln --configuration Release --no-restore
53-
54-
- name: Run Unittests
55-
run: bash run-tests-netcore.sh Rubjerg.Graphviz.Test/Rubjerg.Graphviz.Test.csproj
56-
57-
- name: Run Transitive Tests
58-
run: bash run-tests-netcore.sh Rubjerg.Graphviz.TransitiveTest/Rubjerg.Graphviz.TransitiveTest.csproj
59-
60-
- name: Locate nupkg
61-
id: pkg
62-
run: |
63-
pkg=$(find . -name "Rubjerg.Graphviz.*.nupkg" | head -1)
64-
echo "package=$pkg" >> "$GITHUB_OUTPUT"
65-
66-
- uses: actions/upload-artifact@v4
67-
with:
68-
name: linux-bits
69-
path: ${{ steps.pkg.outputs.package }}
70-
retention-days: 3
1+
name: linux-build
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
artifact-name:
7+
description: "Linux bits"
8+
value: linux-bits
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
name: Checkout Code
17+
18+
# Necessary for running neato
19+
- name: Install libgts
20+
run: sudo apt-get update && sudo apt-get install -y libgts-0.7-5
21+
22+
- name: Setup .NET
23+
uses: actions/setup-dotnet@v3
24+
with:
25+
dotnet-version: 8.0.x
26+
27+
- name: Setup Just
28+
uses: extractions/setup-just@v3
29+
30+
- name: Restore tools
31+
run: just restore-tools
32+
33+
- name: Restore NuGet packages
34+
run: just restore
35+
36+
- name: Build app
37+
run: just build-package
38+
39+
- name: Restore NuGet packages for tests
40+
run: just restore-tests
41+
42+
- name: Build tests
43+
run: just build-tests
44+
45+
- name: Run unit tests (.NET 8)
46+
shell: bash
47+
run: just test Rubjerg.Graphviz.Test/Rubjerg.Graphviz.Test.csproj
48+
49+
- name: Run transitive tests (.NET 8)
50+
shell: bash
51+
run: just test Rubjerg.Graphviz.TransitiveTest/Rubjerg.Graphviz.TransitiveTest.csproj
52+
53+
- name: Locate nupkg
54+
id: pkg
55+
run: |
56+
pkg=$(find . -name "Rubjerg.Graphviz.*.nupkg" | head -1)
57+
echo "package=$pkg" >> "$GITHUB_OUTPUT"
58+
59+
- uses: actions/upload-artifact@v4
60+
with:
61+
name: linux-bits
62+
path: ${{ steps.pkg.outputs.package }}
63+
retention-days: 3

.github/workflows/win-build.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,40 @@ jobs:
1616
build:
1717
runs-on: windows-latest
1818
steps:
19-
- uses: actions/checkout@v1
19+
- uses: actions/checkout@v4
2020
name: Checkout Code
2121

2222
- name: Add msbuild to PATH
2323
uses: microsoft/setup-msbuild@v1.0.2
2424

2525
- name: Setup NuGet.exe for use with actions
2626
uses: NuGet/setup-nuget@v1.0.5
27+
28+
- name: Setup Just
29+
uses: extractions/setup-just@v3
2730

28-
- name: Restore Tools
29-
run: dotnet tool restore
31+
- name: Restore tools
32+
run: just restore-tools
3033

31-
- name: Restore NuGet Packages
32-
run: nuget restore Rubjerg.Graphviz.sln
34+
- name: Restore NuGet packages
35+
run: just restore
3336

34-
- name: Build App
35-
run: msbuild Rubjerg.Graphviz.sln /p:Configuration=Release
37+
- name: Build app
38+
run: just build-package
3639

37-
- name: Restore (just built) NuGet Packages for Tests
38-
run: nuget restore Rubjerg.Graphviz.Tests.sln
40+
- name: Restore NuGet packages for tests
41+
run: just restore-tests
3942

40-
- name: Build Tests
41-
run: msbuild Rubjerg.Graphviz.Tests.sln /p:Configuration=Release
43+
- name: Build tests
44+
run: just build-tests
4245

43-
- name: Run Unittests (.NET 8)
44-
run: bash run-tests-netcore.sh Rubjerg.Graphviz.Test\Rubjerg.Graphviz.Test.csproj
46+
- name: Run unit tests (.NET 8)
47+
shell: bash
48+
run: just test Rubjerg.Graphviz.Test/Rubjerg.Graphviz.Test.csproj
4549

46-
- name: Run Transitive Tests (.NET 8)
47-
run: bash run-tests-netcore.sh Rubjerg.Graphviz.TransitiveTest\Rubjerg.Graphviz.TransitiveTest.csproj
50+
- name: Run transitive tests (.NET 8)
51+
shell: bash
52+
run: just test Rubjerg.Graphviz.TransitiveTest/Rubjerg.Graphviz.TransitiveTest.csproj
4853

4954

5055
# Locate the package that GeneratePackageOnBuild just produced

0 commit comments

Comments
 (0)