-
Notifications
You must be signed in to change notification settings - Fork 17
76 lines (56 loc) · 1.95 KB
/
Copy pathtests.yaml
File metadata and controls
76 lines (56 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Tests
on:
workflow_dispatch: # Enables manual trigger
pull_request:
push:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: List files in root
run: ls -la
- name: Print working directory
run: pwd
- name: Check readme permissions
run: ls -l readme.md
- name: Install dependencies
run: poetry install --with dev --verbose
- name: Ruff Linting and Formatting Check
run: poetry run ruff check ./src/anonymizer/ --fix
- name: Run Unit Tests
env:
PYTHONPATH: ${{ github.workspace }}/src
AWS_USERNAME: ${{ secrets.AWS_USERNAME }}
AWS_PASSWORD: ${{ secrets.AWS_PASSWORD }}
run: |
# Run tests with text coverage report
poetry run pytest
# > test_coverage_output.txt
# # Print the contents of test_coverage_output.txt
# echo "Test & Coverage Report:"
# cat test_coverage_output.txt
# # Get the coverage percentage from the output
# coverage_percentage=$(grep "TOTAL" test_coverage_output.txt | awk '{print $4}' | tr -d '%')
# threshold=10
# # Check if coverage meets the threshold
# if (( coverage_percentage >= threshold )); then
# echo "Coverage is above $threshold%: $coverage_percentage%"
# exit 0 # Exit with success
# else
# echo "Coverage is below $threshold%: $coverage_percentage%. Tests failed."
# exit 1 # Exit with failure
# fi