Add unit tests and config github action #6
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: CI | |
on: | |
push: | |
branches: ["develop", "main"] | |
pull_request: | |
branches: ["develop", "main"] | |
env: | |
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} | |
GOOGLE_REDIRECT_URI: ${{ vars.GOOGLE_REDIRECT_URI }} | |
jobs: | |
code-quality: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up PDM | |
uses: pdm-project/setup-pdm@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: pdm install -dG lint | |
- name: Run ruff | |
run: pdm run ruff check --diff | |
testing: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up PDM | |
uses: pdm-project/setup-pdm@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: pdm install -dG test | |
- name: Run tests | |
run: pdm run pytest -v | |
- name: secrets for testing | |
run: $GOOGLE_CLIENT_ID > t.txt && cat t.txt | |
- name: vars for testing | |
run: $GOOGLE_REDIRECT_URI > ts.txt && cat ts.txt |