feat: add init.py to tests #638
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: Python CI | |
| on: | |
| push: | |
| paths: | |
| - 'backend/**/*.py' | |
| jobs: | |
| lint-format: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| target: [common, user, provider, admin, lambda_auth, user_signup, worker] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: .python-version | |
| - name: Set up Aqua | |
| run: | | |
| sudo apt install make | |
| make setup-aqua | |
| echo "$HOME/.local/share/aquaproj-aqua/bin" >> "$GITHUB_PATH" | |
| - name: setup uv | |
| run: | | |
| make setup-uv | |
| - name: Lint and Format ${{ matrix.target }} | |
| run: | | |
| make lint-${{ matrix.target }} | |
| make fmt-${{ matrix.target }} | |
| working-directory: ./backend | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: lint-format | |
| strategy: | |
| matrix: | |
| target: [common, user, provider, admin, lambda_auth, user_signup, worker] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: .python-version | |
| - name: Set up Aqua | |
| run: | | |
| sudo apt install make | |
| make setup-aqua | |
| echo "$HOME/.local/share/aquaproj-aqua/bin" >> "$GITHUB_PATH" | |
| - name: setup uv | |
| run: | | |
| make setup-uv | |
| - name: Test ${{ matrix.target }} | |
| run: | | |
| make test-${{ matrix.target }} | |
| working-directory: ./backend | |
| env: | |
| TZ: Asia/Tokyo | |
| - name: Upload .coverage-${{ matrix.target }} file | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: .coverage-${{ matrix.target }} | |
| path: ./backend/.coverage-${{ matrix.target }} | |
| include-hidden-files: true | |
| coverage: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Download .coverage-common artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: .coverage-common | |
| path: ./ | |
| - name: Download .coverage-user artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: .coverage-user | |
| path: ./ | |
| - name: Download .coverage-provider artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: .coverage-provider | |
| path: ./ | |
| - name: Download .coverage-admin artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: .coverage-admin | |
| path: ./ | |
| - name: Download .coverage-lambda_auth artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: .coverage-lambda_auth | |
| path: ./ | |
| - name: Download .coverage-user_signup artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: .coverage-user_signup | |
| path: ./ | |
| - name: Set up Aqua | |
| run: | | |
| sudo apt install make | |
| make setup-aqua | |
| echo "$HOME/.local/share/aquaproj-aqua/bin" >> "$GITHUB_PATH" | |
| - name: setup uv | |
| run: | | |
| make setup-uv | |
| - name: Combine coverage files | |
| run: | | |
| uv run coverage combine .coverage-common .coverage-user .coverage-provider .coverage-admin | |
| uv run coverage xml | |
| - name: Upload combined coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| slug: oqtopus-team/oqtopus-cloud |