-
Notifications
You must be signed in to change notification settings - Fork 0
Test workflow on pushes or pull requests #3
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
890e974
chore: add test github workflow
J0sueTM 71f18f2
fix: pull submodules as well
J0sueTM 584133c
fix: generate seed according to what munit wants
J0sueTM cc6ef9b
style: echo generated seed
J0sueTM ddb3d30
style: move seed generation to the same step as test run
J0sueTM File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,39 @@ | ||
| name: test-on-push-or-pr | ||
| on: | ||
| push: | ||
| branches: main | ||
| pull_request: | ||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - name: Build makefiles with premake | ||
| uses: eariassoto/setup-premake@v1 | ||
| with: | ||
| version: '5.0.0-beta1' | ||
| action: 'gmake' | ||
| options: '--cc=gcc' | ||
|
|
||
| - name: Install GCC | ||
| uses: egor-tensin/setup-gcc@v1 | ||
| with: | ||
| version: latest | ||
| platform: x64 | ||
|
|
||
| - name: Build tests | ||
| run: make tests | ||
|
|
||
| - name: Run tests | ||
| run: | | ||
| # From munit's help: | ||
| # | ||
| # Must be a 32-bit integer in decimal notation with no | ||
| # separators (commas, decimals, spaces, etc.), or hexidecimal | ||
| # prefixed by "0x". | ||
| TEST_SEED=$((RANDOM << 16 | RANDOM)) | ||
| echo "Seed generated: $TEST_SEED" | ||
| ./bin/tests/dbg/tests --seed "$TEST_SEED" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Pin GCC to a specific version instead of
latest.Using
latestfor GCC breaks reproducibility—builds may differ between CI runs. Pin to a specific stable version.- name: Install GCC uses: egor-tensin/setup-gcc@v1 with: - version: latest + version: '13' platform: x64Adjust the version number to match your project's requirements.
🏁 Script executed:
Length of output: 276
🏁 Script executed:
Length of output: 445
🌐 Web query:
💡 Result:
Short answer: using egor-tensin/setup-gcc with version: latest will install whatever the action’s default “latest” GCC is at the time the workflow runs — that value can change over time — so workflows that use version: latest are not reproducible across runs. Pin a concrete GCC version (e.g. version: 11 or version: 12) or pin the action tag/commit to get reproducible toolchains. [1][2]
Details / evidence:
Recommendation:
Sources:
[1] setup-gcc README (action docs). (git.tensin.name)
[2] Action usage / advisor listing (usage and popularity). (app.stepsecurity.io)
Citations:
Pin GCC to a specific version instead of
latestto ensure reproducible builds.Using
version: latestinstalls whatever the action's default GCC is at the time the workflow runs—that value can change over time—making workflows non-reproducible across runs. Specify an explicit GCC release (e.g. version: 13) to maintain consistent toolchain behavior.- name: Install GCC uses: egor-tensin/setup-gcc@v1 with: - version: latest + version: '13' platform: x64📝 Committable suggestion
🤖 Prompt for AI Agents