Skip to content

Commit

Permalink
chore: create test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Spotika committed Aug 3, 2024
1 parent 4eea01b commit d45a8e7
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
47 changes: 47 additions & 0 deletions .github/workflows/test.yaml
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
2 changes: 1 addition & 1 deletion tests/package.json
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": {
Expand Down

0 comments on commit d45a8e7

Please sign in to comment.