Feature/add pytest workflow #17
This file contains hidden or 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 Pytest | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| pytest: | |
| runs-on: ubuntu-latest | |
| env: | |
| DB_USER: "Postgres" | |
| DB_PASSWORD: "postgres" | |
| DB_HOST: "localhost" | |
| DB_PORT: "5432" | |
| DB_NAME: "postgres" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Run pytest | |
| run: pytest | |
| - name: Failure log | |
| if: failure() | |
| run: echo "1つ前のステップは失敗しました!" | |
| - name: Print secrets | |
| run: echo "TEST_API_KEY -> ${{secrets.TEST_API_KEY}}" | |
| - name: Print DB environment variables | |
| run: echo "DB_USER -> ${{env.DB_USER}} | |
| DB_PASSWORD -> ${{env.DB_PASSWORD}} | |
| DB_HOST -> ${{env.DB_HOST}} | |
| DB_PORT -> ${{env.DB_PORT}} | |
| DB_NAME -> ${{env.DB_NAME}}" |