-
Notifications
You must be signed in to change notification settings - Fork 298
the ability to automatically run unit tests after creating a pull request. #764
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
Open
AsterZephyr
wants to merge
14
commits into
apache:master
Choose a base branch
from
AsterZephyr:feature/762-unit-test-workflow
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a4df506
feat: add unit test workflow
AsterZephyr 17ef225
feat:the ability to automatically run unit tests after creating a pul…
AsterZephyr 73cf2a9
feat:the ability to automatically run unit tests after creating a pul…
AsterZephyr ac0af96
feat:the ability to automatically run unit tests after creating a pul…
AsterZephyr 6f6324a
feat:the ability to automatically run unit tests after creating a pul…
AsterZephyr 32ccc65
feat:the ability to automatically run unit tests after creating a pul…
AsterZephyr e488a54
feat:the ability to automatically run unit tests after creating a pul…
AsterZephyr 8510c8b
Merge branch 'master' into feature/762-unit-test-workflow
slievrly e8e0b3e
Merge branch 'master' into feature/762-unit-test-workflow
luky116 d5d9aec
Merge branch 'master' into feature/762-unit-test-workflow
Code-Fight fcbd3a0
Merge branch 'master' into feature/762-unit-test-workflow
luky116 37f9533
Merge branch 'master' into feature/762-unit-test-workflow
Code-Fight 2f64bed
Merge branch 'master' into feature/762-unit-test-workflow
Code-Fight 44c6d7d
Merge branch 'master' into feature/762-unit-test-workflow
Code-Fight 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
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,78 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
name: "Unit Test" | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ "*" ] | ||
types: [opened, synchronize, reopened] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
unit-test: | ||
name: Unit Test | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
strategy: | ||
matrix: | ||
golang: | ||
- 1.18 | ||
|
||
steps: | ||
- name: "Set up Go" | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.golang }} | ||
|
||
- name: "Checkout code" | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: "Cache dependencies" | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: "${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}" | ||
restore-keys: | | ||
"${{ runner.os }}-go-" | ||
|
||
- name: Shutdown default mysql | ||
run: sudo service mysql stop | ||
|
||
|
||
- name: "Run Unit Tests" | ||
run: | | ||
echo "=== Starting Unit Tests ===" | ||
go test -v ./... -race -coverprofile=coverage.txt -covermode=atomic -timeout 10m | ||
if [ $? -ne 0 ]; then | ||
echo "❌ Unit tests failed" | ||
exit 1 | ||
fi | ||
echo "✅ Unit tests completed successfully" | ||
|
||
- name: "Archive test results" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The PR description mentions uploading coverage to Codecov, but there’s no Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-results | ||
path: coverage.txt | ||
retention-days: 7 |
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.
[nitpick] This explicit exit check is redundant—GitHub Actions will fail on a non-zero exit by default. Consider simplifying by running
go test ...
directly.Copilot uses AI. Check for mistakes.