File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -16,18 +16,20 @@ concurrency:
16
16
cancel-in-progress : true
17
17
18
18
jobs :
19
- test-sudo :
19
+ test :
20
20
runs-on : ${{ matrix.os }}
21
21
strategy :
22
22
matrix :
23
- os : [ubuntu-20.04, macos-13]
23
+ os : [ubuntu-20.04, macos-13, windows-2019 ]
24
24
fail-fast : false
25
25
steps :
26
26
- uses : actions/checkout@v4
27
- - name : Build V
28
- run : make -j4
29
- - name : Symlink
30
- run : sudo ./v symlink
27
+ - name : Build and symlink (Windows)
28
+ if : runner.os == 'Windows'
29
+ run : ./make.bat && ./v symlink
30
+ - name : Build and symlink
31
+ if : runner.os != 'Windows'
32
+ run : make -j4 && sudo ./v symlink
31
33
- name : Check if V is usable
32
34
run : |
33
35
pwd
Original file line number Diff line number Diff line change @@ -83,6 +83,20 @@ fn setup_symlink() {
83
83
warn_and_exit ('You might need to run this again to have the `v` command in your %PATH%' )
84
84
}
85
85
C.RegCloseKey (reg_sys_env_handle)
86
+ if os.getenv ('GITHUB_JOB' ) != '' {
87
+ // Append V's install location to GITHUBs PATH environment variable.
88
+ // Resources:
89
+ // 1. https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files
90
+ // 2. https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
91
+ mut content := os.read_file (os.getenv ('GITHUB_PATH' )) or {
92
+ eprintln ('The `GITHUB_PATH` env variable is not defined.' )
93
+ exit (1 )
94
+ }
95
+ content + = '\n ${new_sys_env_path} \n '
96
+ os.write_file (os.getenv ('GITHUB_PATH' ), content) or {
97
+ panic ('Failed to write to GITHUB_PATH.' )
98
+ }
99
+ }
86
100
println ('Done.' )
87
101
println ('Note: Restart your shell/IDE to load the new %PATH%.' )
88
102
println ('After restarting your shell/IDE, give `v version` a try in another directory!' )
You can’t perform that action at this time.
0 commit comments