From 9b693e61a3f740b0ae5c1cfd15fddd037a421bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Gu=CC=88ndu=CC=88z?= Date: Sat, 11 Sep 2021 22:47:13 +0200 Subject: [PATCH] Remove unnecessary argument + add to main tests --- .github/workflows/main.yml | 38 +++++++++++++++++++++++++++++- .github/workflows/pull-request.yml | 4 ++-- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7b1f7f8..7f451e4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v2 - name: Run tests - run: swift test -v --enable-test-discovery + run: swift test -v test-macos: runs-on: macos-latest @@ -22,3 +22,39 @@ jobs: - name: Run tests run: swift test -v --enable-code-coverage + + # originally from: https://github.com/compnerd/swift-build/blob/master/.github/workflows/swift-argument-parser.yml + test-windows: + runs-on: windows-latest + + strategy: + matrix: + include: + - tag: 5.4.3-RELEASE + branch: swift-5.4.3-release + + steps: + - uses: actions/checkout@v2 + + - name: Install Swift ${{ matrix.tag }} + run: | + function Update-EnvironmentVariables { + foreach ($level in "Machine", "User") { + [Environment]::GetEnvironmentVariables($level).GetEnumerator() | % { + # For Path variables, append the new values, if they're not already in there + if ($_.Name -Match 'Path$') { + $_.Value = ($((Get-Content "Env:$($_.Name)") + ";$($_.Value)") -Split ';' | Select -Unique) -Join ';' + } + $_ + } | Set-Content -Path { "Env:$($_.Name)" } + } + } + + Install-Binary -Url "https://swift.org/builds/${{ matrix.branch }}/windows10/swift-${{ matrix.tag }}/swift-${{ matrix.tag }}-windows10.exe" -Name "installer.exe" -ArgumentList ("-q") + Update-EnvironmentVariables + # Reset Path and environment + echo "$env:Path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 + Get-ChildItem Env: | % { echo "$($_.Name)=$($_.Value)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append } + + - name: Run tests + run: swift test -v diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index c95a492..be4f47f 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -33,7 +33,7 @@ jobs: - uses: actions/checkout@v2 - name: Run tests - run: swift test -v --enable-test-discovery + run: swift test -v test-macos: runs-on: macos-latest @@ -78,4 +78,4 @@ jobs: Get-ChildItem Env: | % { echo "$($_.Name)=$($_.Value)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append } - name: Run tests - run: swift test -v --enable-test-discovery + run: swift test -v