-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
146 changed files
with
6,510 additions
and
3,024 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
* text=auto | ||
*.sh eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Build reproducible zip archive | ||
|
||
on: | ||
push: | ||
branches: ['develop', 'release'] | ||
pull_request: | ||
|
||
env: | ||
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
# package のビルド時は *.pdb を生成しない (https://github.com/opentween/OpenTween/pull/256) | ||
msbuild_args: /p:DebugType=None | ||
|
||
package: | ||
runs-on: windows-2022 | ||
needs: [build] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: '${{ github.event.pull_request.head.sha }}' | ||
|
||
- name: Add msbuild to PATH | ||
uses: microsoft/setup-msbuild@v1.1 | ||
|
||
- name: Set configuration env | ||
shell: pwsh | ||
run: | | ||
if ($env:GITHUB_REF -eq 'refs/heads/release') { | ||
echo 'CONFIGURATION=Release' >> $env:GITHUB_ENV | ||
} else { | ||
echo 'CONFIGURATION=Debug' >> $env:GITHUB_ENV | ||
} | ||
- name: Restore build result | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: build | ||
|
||
- name: Build package | ||
shell: powershell # runtime-versionを取得するため従来のPowershellを使用する | ||
run: | | ||
$env:PATH = $env:PATH + ';C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Msbuild\Current\Bin\Roslyn\' | ||
$binDir = '.\OpenTween\bin\' + $env:CONFIGURATION + '\net48\' | ||
$destPath = 'OpenTween.zip' | ||
.\tools\build-zip-archive.ps1 -BinDir $binDir -DestPath $destPath | ||
- name: Upload build result | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: package | ||
path: | | ||
./OpenTween.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
name: Run tests | ||
|
||
on: | ||
push: | ||
branches: ['develop', 'release'] | ||
pull_request: | ||
|
||
env: | ||
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yml | ||
|
||
test: | ||
runs-on: windows-2022 | ||
needs: [build] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Add msbuild to PATH | ||
uses: microsoft/setup-msbuild@v1.1 | ||
|
||
- name: Set configuration env | ||
shell: pwsh | ||
run: | | ||
if ($env:GITHUB_REF -eq 'refs/heads/release') { | ||
echo 'CONFIGURATION=Release' >> $env:GITHUB_ENV | ||
} else { | ||
echo 'CONFIGURATION=Debug' >> $env:GITHUB_ENV | ||
} | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ github.workspace }}/.nuget/packages | ||
key: nuget-${{ hashFiles('*/*.csproj') }} | ||
restore-keys: | | ||
nuget- | ||
- name: Restore build result | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: build | ||
|
||
- name: Run tests | ||
shell: pwsh | ||
run: | | ||
$altCoverVersion = '8.6.95' | ||
$xunitVersion = '2.6.2' | ||
$targetFramework = 'net48' | ||
$altCoverPath = "$($env:NUGET_PACKAGES)\altcover\$($altCoverVersion)\tools\net472\AltCover.exe" | ||
$xunitPath = "$($env:NUGET_PACKAGES)\xunit.runner.console\$($xunitVersion)\tools\net481\xunit.console.exe" | ||
$p = Start-Process ` | ||
-FilePath $altCoverPath ` | ||
-ArgumentList ( | ||
'--inputDirectory', | ||
".\OpenTween.Tests\bin\$($env:CONFIGURATION)\$($targetFramework)", | ||
'--outputDirectory', | ||
'.\__Instrumented\', | ||
'--assemblyFilter', | ||
'?^OpenTween(?!\.Tests)', | ||
'--typeFilter', | ||
'?^OpenTween\.', | ||
'--fileFilter', | ||
'\.Designer\.cs', | ||
'--visibleBranches' | ||
) ` | ||
-NoNewWindow ` | ||
-PassThru ` | ||
-Wait | ||
if ($p.ExitCode -ne 0) { | ||
exit $p.ExitCode | ||
} | ||
$p = Start-Process ` | ||
-FilePath $altCoverPath ` | ||
-ArgumentList ( | ||
'runner', | ||
'--recorderDirectory', | ||
'.\__Instrumented\', | ||
'--executable', | ||
$xunitPath, | ||
'--', | ||
'.\__Instrumented\OpenTween.Tests.dll' | ||
) ` | ||
-NoNewWindow ` | ||
-PassThru ` | ||
-Wait | ||
if ($p.ExitCode -ne 0) { | ||
exit $p.ExitCode | ||
} | ||
- uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
fail_ci_if_error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.