deubg pypi publish error: invalid-publisher
: valid token, but no c…
#15
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
name: Tests | |
on: | |
workflow_dispatch: # Enables manual trigger | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- 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: 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 | |