Skip to content

Commit

Permalink
👍 Improve the actions
Browse files Browse the repository at this point in the history
  • Loading branch information
AutumnSky1010 committed Mar 10, 2024
1 parent e0a5ee7 commit 653217c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
configuration: [Debug, Release]
configuration: [Release]

runs-on: ubuntu-latest

Expand All @@ -31,12 +31,18 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x


# Restore dependencies
- name: Restore dependencies
run: dotnet restore
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

- name: Execute build with warn as error
run: dotnet build --no-restore /warnaserror
# Build the test project
- name: Build the test project
run: dotnet build test/SoundMakerTests/SoundMakerTests.csproj --no-restore

# Execute all unit tests in the solution
- name: Execute unit tests
Expand Down
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

0 comments on commit 653217c

Please sign in to comment.