Skip to content

Commit 508c905

Browse files
committed
README.md,GitHubCI: add nice make experience
In Unix (macOS / Linux), it's just the simplest Makefile that calls FAKE targets underneath. In Windows, it's a batch file that does the same.
1 parent d3ec2c5 commit 508c905

File tree

4 files changed

+43
-7
lines changed

4 files changed

+43
-7
lines changed

.github/workflows/build+test+deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ jobs:
3636
- name: Restore dependencies
3737
run: dotnet restore
3838
- name: Build
39-
run: dotnet fsi build.fsx -t Build
39+
run: make
4040
- name: Run tests
41-
run: dotnet fsi build.fsx -t Test
41+
run: make check
4242
- name: Run FSharpLint on itself
43-
run: dotnet fsi build.fsx -t SelfCheck
43+
run: make selfcheck
4444

4545

4646
deployReleaseBinaries:
@@ -114,7 +114,7 @@ jobs:
114114
- name: Restore dependencies
115115
run: dotnet restore
116116
- name: Run Fornax
117-
run: dotnet fsi build.fsx -t Docs
117+
run: make docs
118118
- name: Deploy (if tag)
119119
if: startsWith(github.ref, 'refs/tags/')
120120
uses: peaceiris/actions-gh-pages@v3

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
all:
2+
which dotnet > /dev/null || { echo "ERROR: 'dotnet' not found. Please ensure you have installed .NET (the version specified in global.json)" >&2; exit 1; }
3+
dotnet fsi build.fsx --target Build
4+
5+
check:
6+
dotnet fsi build.fsx --target Test
7+
8+
selfcheck:
9+
dotnet fsi build.fsx --target SelfCheck
10+
11+
docs:
12+
dotnet fsi build.fsx --target Docs
13+

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ Package | Version
3939

4040
1. Make sure you've installed the .NET version defined in [global.json](global.json)
4141
2. Run `dotnet tool restore` to install all developer tools required to build the project
42-
3. Run `dotnet fsi build.fsx -t Build` to build (which executes the `Build` target from the FAKE-based [build script](build.fsx))
43-
4. To run tests use `dotnet fsi build.fsx -t Test`
44-
5. To build documentation use `dotnet fsi build.fsx -t Docs`
42+
3. Run `make` to build (which executes the `Build` target from the FAKE-based [build script](build.fsx))
43+
4. To run tests use `make check`
44+
5. To build documentation use `make docs`
4545

4646
## How to work with documentation
4747

make.cmd

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@ECHO OFF
2+
where /q dotnet
3+
IF ERRORLEVEL 1 (
4+
ECHO "ERROR: 'dotnet' not found. Please ensure you have installed .NET (the version specified in global.json)" && EXIT /b 1
5+
) ELSE (
6+
IF "%~1" == "" (
7+
dotnet fake build --target Build
8+
) ELSE (
9+
IF "%~1" == "check" (
10+
dotnet fake build --target Test
11+
) ELSE (
12+
IF "%~1" == "selfcheck" (
13+
dotnet fake build --target SelfCheck
14+
) ELSE (
15+
IF "%~1" == "docs" (
16+
dotnet fake build --target Docs
17+
) ELSE (
18+
ECHO "Target was not recognized" && EXIT /b 1
19+
)
20+
)
21+
)
22+
)
23+
)

0 commit comments

Comments
 (0)