-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Spotika
committed
Aug 3, 2024
1 parent
4eea01b
commit d45a8e7
Showing
2 changed files
with
48 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Test API | ||
|
||
on: | ||
push: | ||
branches: | ||
- total-fix-authorization # Замените "main" на вашу основную ветку | ||
|
||
jobs: | ||
test: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Compose | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Build and run Docker Compose | ||
run: | | ||
docker-compose up --build -d test | ||
docker-compose logs -f test > test_logs.txt | ||
continue-on-error: true | ||
|
||
- name: Check test results | ||
run: | | ||
if grep -q "Test Suites: .* failed" test_logs.txt; then | ||
echo "Tests failed" | ||
exit 1 | ||
else | ||
echo "Tests passed" | ||
fi | ||
- name: Check pylint results | ||
run: | | ||
cat pylint_output.txt | ||
if ! grep -q "Your code has been rated at 10.00/10" pylint_output.txt; then | ||
echo "Pylint issues found!" | ||
exit 1 | ||
fi | ||
- name: Upload test logs | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: test-logs | ||
path: test_logs.txt |
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,5 +1,5 @@ | ||
{ | ||
"name": "integration_tests", | ||
"name": "tests", | ||
"version": "1.0.0", | ||
"type": "module", | ||
"scripts": { | ||
|