-
Notifications
You must be signed in to change notification settings - Fork 166
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
CI tests for 32bit correction + version of Go update #526
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
39d4745
Switched to matrix
matteosz 8404643
Fixed go version
matteosz 0e525d0
Rm not working manual go version for alpine
matteosz c8d6a87
Removed debugging + fixed go version on x86 + go version to 1.21-1.22
matteosz 3453069
Unified test workflow
matteosz 385ecb1
Upgrade go version + rm matrix from permission
matteosz 24cdf0a
Added concurrency check back
matteosz 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,27 +1,120 @@ | ||
name: Tests | ||
name: CI Workflow for tests | ||
|
||
on: | ||
pull_request_target: | ||
types: [opened, synchronize, reopened, labeled] | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: [ master ] | ||
|
||
concurrency: | ||
group: ci-${{ github.ref }}-test | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
permission: | ||
if: ${{ github.event_name == 'pull_request_target' }} | ||
strategy: | ||
matrix: | ||
platform: [macos-latest, windows-latest, ubuntu-latest] | ||
runs-on: ${{ matrix.platform }} | ||
matteosz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
steps: | ||
- name: Add comment if PR permission failed | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'safe PR') }} | ||
uses: actions/github-script@v3 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
script: | | ||
github.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: '🔒 Could not start CI tests due to missing *safe PR* label. Please contact a DEDIS maintainer.' | ||
}) | ||
- name: Check permission | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'safe PR') }} | ||
run: | | ||
echo "::error:: Could not start CI tests due to missing *safe PR* label." | ||
exit 1 | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
needs: [permission] | ||
strategy: | ||
matrix: | ||
os: [windows-latest, ubuntu-latest, macos-latest] | ||
size: ['64b', '32b'] | ||
golang: ['1.21.10', '1.22.3'] | ||
exclude: | ||
- os: windows-latest | ||
size: '32b' | ||
- os: macos-latest | ||
size: '32b' | ||
|
||
runs-on: ${{ matrix.os }} | ||
env: | ||
DBGSYNCLOG: trace | ||
DBGSYNCON: true | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Go ${{ matrix.golang }} | ||
uses: actions/setup-go@v5 | ||
if: ${{ matrix.size == '64b' }} | ||
with: | ||
go-version: ${{ matrix.golang }} | ||
check-latest: false | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: 0 | ||
|
||
- name: Setup Alpine Linux | ||
uses: jirutka/setup-alpine@v1 | ||
if: ${{ matrix.size == '32b' }} | ||
with: | ||
arch: x86 | ||
packages: > | ||
make | ||
git | ||
gcc | ||
musl-dev | ||
|
||
- name: Test without coverage (Windows, MacOS) | ||
if: ${{ matrix.os == 'macos-latest' || matrix.os == 'windows-latest' }} | ||
run: make test | ||
|
||
- name: Test without coverage (Ubuntu x86) | ||
if: ${{ matrix.size == '32b' }} | ||
run: | | ||
cd .. | ||
wget -O go.tgz -nv https://go.dev/dl/go${{matrix.golang}}.linux-386.tar.gz | ||
tar -xzf go.tgz | ||
export PATH=$PATH:$(pwd)/go/bin | ||
cd kyber | ||
make test | ||
shell: alpine.sh {0} | ||
|
||
- name: Test with coverage | ||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.size == '64b' }} | ||
run: make coverage | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.18' | ||
- name: SonarCloud scan | ||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.size == '64b' }} | ||
uses: sonarsource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
with: | ||
args: > | ||
-Dsonar.organization=dedis | ||
-Dsonar.projectKey=dedis_kyber | ||
-Dsonar.go.tests.reportPaths=report.json | ||
-Dsonar.go.coverage.reportPaths=profile.cov | ||
-Dsonar.pullrequest.key=${{ github.event.number }} | ||
-Dsonar.pullrequest.branch=${{ github.head_ref }} | ||
-Dsonar.pullrequest.base=${{ github.event.pull_request.base }} | ||
-Dsonar.c.file.suffixes=- | ||
-Dsonar.cpp.file.suffixes=- | ||
-Dsonar.objc.file.suffixes=- | ||
|
||
- name: Run tests | ||
run: make test | ||
- name: Send coverage | ||
if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.size == '64b' }} | ||
uses: shogo82148/actions-goveralls@v1 | ||
with: | ||
path-to-profile: profile.cov |
Oops, something went wrong.
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.
Why remove this early cancellation of already running tests when a new commit is pushed in quick succession on a PR?
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.
Nice spot, it was an unwanted removal indeed
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.
We're entering Nirvana territory :)