Username taken: 169 testcases added #32
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: Run tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request_target: | |
permissions: | |
contents: read | |
jobs: | |
python: | |
name: Test web application | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
env: | |
ODBC_CONNECTION_STRING: ${{ secrets.ODBC_CONNECTION_STRING}} | |
VNPAY_TMN_CODE: ${{ secrets.VNPAY_TMN_CODE }} | |
VNPAY_SECRET_KEY: ${{ secrets.VNPAY_SECRET_KEY }} | |
PRIVATE_KEY_SEED: ${{ secrets.PRIVATE_KEY_SEED }} | |
PORT: 8000 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
# IMPORTANT: Change settings in Actions/General to "Require approval for all outside collaborators". | |
# Before approving workflow from public forks, triple check the code. | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: pip install -r dev-requirements.txt | |
- name: Install ODBC driver 18 | |
run: | | |
chmod +x scripts/odbc.sh | |
scripts/odbc.sh | |
- name: Run tests | |
run: coverage run -m pytest -v . | |
- name: Combine coverage reports | |
run: coverage combine | |
- name: Report coverage | |
run: coverage report -m | |
- name: Generate HTML coverage report | |
run: coverage html -d htmlcov | |
- name: Upload HTML coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-html-${{ matrix.python-version }} | |
path: htmlcov | |
flutter: | |
name: Test client application | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
env: | |
PRIVATE_KEY_SEED: ${{ secrets.PRIVATE_KEY_SEED }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: 3.24.3 | |
channel: stable | |
- name: View Flutter status | |
run: | | |
flutter --version | |
flutter doctor -v | |
- name: Run tests | |
working-directory: app/resident_manager | |
run: flutter test |