-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:the ability to automatically run unit tests after creating a pul…
…l request.
- Loading branch information
1 parent
73cf2a9
commit ac0af96
Showing
2 changed files
with
21 additions
and
8 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -59,12 +59,31 @@ jobs: | |
restore-keys: | | ||
"${{ runner.os }}-go-" | ||
- name: Shutdown default mysql | ||
run: sudo service mysql stop | ||
|
||
- name: Create mysql database auth | ||
uses: mirromutth/[email protected] | ||
with: | ||
host port: 3306 | ||
container port: 3306 | ||
mysql version: '8.0' | ||
mysql database: 'seata_go_test' | ||
mysql root password: 'seata_go' | ||
|
||
- name: "Run Unit Tests" | ||
run: | | ||
echo "=== Starting Unit Tests ===" | ||
go test -v ./... -coverprofile=coverage.txt -covermode=atomic -timeout 10m | ||
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" | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-results | ||
path: coverage.txt | ||
retention-days: 7 |