Skip to content

Commit 6b545c0

Browse files
committed
CI: add initial attempt to add CI coverage
This adds pre-commit builds for testing changes.
1 parent ca7d39b commit 6b545c0

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/build.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: build
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
windows:
9+
strategy:
10+
matrix:
11+
include:
12+
- branch: swift-5.4.3-release
13+
tag: 5.4.3-RELEASE
14+
15+
- branch: swift-5.5-release
16+
tag: 5.5-RELEASE
17+
18+
- branch: development
19+
tag: DEVELOPMENT-SNAPSHOT-2021-09-18-a
20+
21+
steps:
22+
- name: Install Swift ${{ matrix.tag }}
23+
run: |
24+
function Update-EnvironmentVariables {
25+
foreach ($level in "Machine", "User") {
26+
[Environment]::GetEnvironmentVariables($level).GetEnumerator() | % {
27+
# For Path variables, append the new values, if they're not already in there
28+
if ($_.Name -Match 'Path$') {
29+
$_.Value = ($((Get-Content "Env:$($_.Name)") + ";$($_.Value)") -Split ';' | Select -Unique) -Join ';'
30+
}
31+
$_
32+
} | Set-Content -Path { "Env:$($_.Name)" }
33+
}
34+
}
35+
36+
Install-Binary -Url "https://swift.org/builds/${{ matrix.branch }}/windows10/swift-${{ matrix.tag }}/swift-${{ matrix.tag }}-windows10.exe" -Name "installer.exe" -ArgumentList ("-q")
37+
Update-EnvironmentVariables
38+
39+
# Reset Path and environment
40+
echo "$env:Path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
41+
Get-ChildItem Env: | % { echo "$($_.Name)=$($_.Value)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append }
42+
43+
- uses: actions/checkout@v2
44+
45+
- name: configure
46+
run: cmake -B out -D CMAKE_BUILD_TYPE=Release -G Ninja -S ${{ github.workspace }}
47+
48+
- name: build
49+
run: cmake --build out --configuration Release

0 commit comments

Comments
 (0)