Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GitHub Actions] Add workflow. #16

Merged
merged 4 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: .NET Core Desktop

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:

build:

strategy:
matrix:
configuration: [Release]

runs-on: ubuntu-latest

env:
Solution_Name: SoundMaker.sln # Replace with your solution name, i.e. MyWpfApp.sln.
Test_Project_Path: test/SoundMakerTests.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

# Restore dependencies
- name: Restore dependencies
run: dotnet restore src/SoundMaker/SoundMaker.csproj; dotnet restore test/SoundMakerTests.csproj

# Build the SoundMaker project
- name: Build the SoundMaker project with warns as errors
run: dotnet build src/SoundMaker/SoundMaker.csproj --no-restore --warnaserror

# Build the test project
- name: Build the test project
run: dotnet build test/SoundMakerTests.csproj --no-restore

# Execute all unit tests in the solution
- name: Execute unit tests
run: dotnet test
18 changes: 9 additions & 9 deletions test/UseCaseTests/CreateWaveFileTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class CreateWaveFileTest
{
private List<WaveCase> MonauralWaveCases { get; } = new List<WaveCase>
{
new WaveCase()
new()
{
FormatChunk = new FormatChunk(
SoundMaker.WaveFile.SamplingFrequencyType.FourtyEightKHz,
Expand All @@ -20,7 +20,7 @@ public class CreateWaveFileTest
SoundMaker.Sounds.ChannelType.Monaural),
Path = @"Sounds\48000hz16bit1ch"
},
new WaveCase()
new()
{
FormatChunk = new FormatChunk(
SoundMaker.WaveFile.SamplingFrequencyType.FourtyEightKHz,
Expand All @@ -33,7 +33,7 @@ public class CreateWaveFileTest
Path = @"Sounds\48000hz8bit1ch"
},

new WaveCase()
new()
{
FormatChunk = new FormatChunk(
SoundMaker.WaveFile.SamplingFrequencyType.FourtyFourKHz,
Expand All @@ -45,7 +45,7 @@ public class CreateWaveFileTest
SoundMaker.Sounds.ChannelType.Monaural),
Path = @"Sounds\44100hz16bit1ch"
},
new WaveCase()
new()
{
FormatChunk = new FormatChunk(
SoundMaker.WaveFile.SamplingFrequencyType.FourtyFourKHz,
Expand All @@ -62,7 +62,7 @@ public class CreateWaveFileTest
private List<WaveCase> StereoWaveCases { get; } = new List<WaveCase>
{

new WaveCase()
new()
{
FormatChunk = new FormatChunk(
SoundMaker.WaveFile.SamplingFrequencyType.FourtyEightKHz,
Expand All @@ -74,7 +74,7 @@ public class CreateWaveFileTest
SoundMaker.Sounds.ChannelType.Stereo),
Path = @"Sounds\48000hz16bit2ch"
},
new WaveCase()
new()
{
FormatChunk = new FormatChunk(
SoundMaker.WaveFile.SamplingFrequencyType.FourtyEightKHz,
Expand All @@ -86,7 +86,7 @@ public class CreateWaveFileTest
SoundMaker.Sounds.ChannelType.Stereo),
Path = @"Sounds\48000hz8bit2ch"
},
new WaveCase()
new()
{
FormatChunk = new FormatChunk(
SoundMaker.WaveFile.SamplingFrequencyType.FourtyFourKHz,
Expand All @@ -98,7 +98,7 @@ public class CreateWaveFileTest
SoundMaker.Sounds.ChannelType.Stereo),
Path = @"Sounds\44100hz16bit2ch"
},
new WaveCase()
new()
{
FormatChunk = new FormatChunk(
SoundMaker.WaveFile.SamplingFrequencyType.FourtyFourKHz,
Expand Down Expand Up @@ -182,7 +182,7 @@ private void WriteFile(byte[] wave, FormatChunk format, string name)
var writer = new WaveWriter(format, sound);
var filePath = $"{name}.wav";
writer.Write(filePath);
Console.WriteLine($"{filePath}を書き込んだよ");
Console.WriteLine($"Success: Write {filePath}");
}

private static StereoWave GetStereo(ISoundChannel channel)
Expand Down
Loading