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

Create a GitHub Action that builds and runs unit tests #88

Open
sevagh opened this issue Dec 27, 2023 · 5 comments
Open

Create a GitHub Action that builds and runs unit tests #88

sevagh opened this issue Dec 27, 2023 · 5 comments

Comments

@sevagh
Copy link
Owner

sevagh commented Dec 27, 2023

No description provided.

@prabhjotsingh18
Copy link

Hey @sevagh ,

I would love to take this up, If you can let me know the steps involved in the process of building and commands to run tests

@sevagh
Copy link
Owner Author

sevagh commented Dec 31, 2023

You can do it pretty easily with the included Docker image.

  1. Use the standard checkout workflow of github actions (https://github.com/actions/checkout) to clone the code (make sure you use the appropriate options to enable git-lfs, since the test data files are stored with git-lfs: https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-git-large-file-storage
  2. You can probably use the free ubuntu-latest runner
  3. Run the docker build command, using a docker workflow or just a bash run command in GitHub Actions: docker build --rm --pull -f "Dockerfile" -t pitchdetection:latest "."
  4. Run the unit tests in the container: docker run --rm --init -it pitchdetection:latest /usr/src/pitch-detection/build/pitch_tests
  5. Run the benchmark in the container: docker run --rm --init -it pitchdetection:latest /usr/src/pitch-detection/build/pitch_bench

We can also possibly look at GHCR.io/github's container registry to store the pitch_detection docker container as a release artifact: https://docs.github.com/en/actions/publishing-packages/publishing-docker-images

@sevagh
Copy link
Owner Author

sevagh commented Dec 31, 2023

Feel free to explore at your pace, and ping me when you have any questions. There is no urgency on this issue.

@prabhjotsingh18
Copy link

Hey sevagh,

Thanks for the detailed steps.

While running unit test im getting error code of 139

Run docker run --rm --init -t pitchdetection:latest /usr/src/pitch-detection/build/pitch_tests
Running main() from ./googletest/src/gtest_main.cc
[==========] Running 228 tests from 22 test suites.
[----------] Global test environment set-up.
[----------] 2 tests from MpmSinewaveTestManualAllocFloat
[ RUN      ] MpmSinewaveTestManualAllocFloat.OneAllocMultipleFreqFromFile
Error: Process completed with exit code 13[9](https://github.com/prabhjotsingh18/pitch-detection/actions/runs/7462132679/job/20303759912#step:5:10).

is this expected ?

I also tried the same locally I'm still getting the same error code when running it on my local machine.

@sevagh
Copy link
Owner Author

sevagh commented Jan 9, 2024

Did you make sure to enable git-lfs?

Use the standard checkout workflow of github actions (https://github.com/actions/checkout) to clone the code (make sure you use the appropriate options to enable git-lfs, since the test data files are stored with git-lfs: https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-git-large-file-storage

If you run git lfs ls-files, what happens?

(system) sevagh@pop-os:~/repos/pitch-detection$ git lfs ls-files
5f6ff87b4d * misc/degraded_audio_tests/Viola-deg0.wav
f2ded53416 * misc/degraded_audio_tests/Viola-deg1.wav
c687598952 * misc/degraded_audio_tests/Viola-deg2.wav
0c125d1b40 * misc/degraded_audio_tests/Viola-deg3.wav
85382ee6f4 * misc/degraded_audio_tests/Viola-deg4.wav
96da9d1b2c * misc/degraded_audio_tests/Viola-deg5.wav
700846a8db * misc/degraded_audio_tests/Viola.arco.ff.sulC.E3.stereo.aiff
ada1f0cae6 * misc/degraded_audio_tests/restaurant08.wav
6839a50862 * misc/deps.png
fd6ebe74a3 * misc/mcleod/.github/degraded_e3_nsdf.png
2dc888c12b * misc/mcleod/.github/open_e_autocorrelation.png
...

The test data is stored with git-lfs (git large-file storage), which needs an extra step to clone.

Are there any more messages printed by the failing test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants