[pre-commit.ci] pre-commit autoupdate #2110
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: Ibutsu tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: ["opened", "synchronize", "reopened"] | |
| create: | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v4 | |
| - name: Install dependencies | |
| run: pip install pre-commit | |
| - name: Run pre-commit | |
| run: pre-commit run --all --verbose | |
| lint-test-frontend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: 'frontend/.nvmrc' | |
| cache: 'yarn' | |
| cache-dependency-path: 'frontend/yarn.lock' | |
| - run: yarn install | |
| working-directory: ./frontend | |
| - run: yarn lint | |
| working-directory: ./frontend | |
| - name: Run tests with coverage | |
| run: yarn test:coverage:ci | |
| working-directory: ./frontend | |
| - name: Upload coverage reports | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: frontend-coverage | |
| path: frontend/coverage/ | |
| retention-days: 30 | |
| test-backend: | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| strategy: | |
| matrix: | |
| python-version: [ "3.9", "3.10", "3.11"] # five is broken on 3.11 - celery update needed "3.11.0-alpha - 3.11"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install backend dependencies with Python ${{ matrix.python-version }} | |
| working-directory: ./backend | |
| run: | | |
| python -m pip install --upgrade pip wheel | |
| pip install hatch | |
| - name: Run backend tests with coverage | |
| working-directory: ./backend | |
| run: hatch run test-cov | |
| - name: Upload coverage reports | |
| uses: actions/upload-artifact@v4 | |
| if: always() && matrix.python-version == '3.11' | |
| with: | |
| name: backend-coverage | |
| path: backend/coverage.xml | |
| retention-days: 30 | |
| build-backend: | |
| runs-on: ubuntu-latest | |
| needs: test-backend | |
| if: github.event_name == 'pull_request' | |
| strategy: | |
| matrix: | |
| app: [backend, scheduler, worker] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build image ${{ matrix.app }} | |
| uses: redhat-actions/buildah-build@v2 | |
| with: | |
| context: ./backend | |
| image: ibutsu-${{ matrix.app }} | |
| dockerfiles: | | |
| ./backend/docker/Dockerfile.${{ matrix.app }} | |
| upload-coverage: | |
| runs-on: ubuntu-latest | |
| needs: [test-backend, lint-test-frontend] | |
| if: always() | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all coverage artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: coverage-reports | |
| pattern: '*-coverage*' | |
| - name: Display structure of downloaded files | |
| run: ls -R coverage-reports | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| directory: ./coverage-reports | |
| name: codecov-umbrella | |
| fail_ci_if_error: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| verbose: true | |
| build-frontend: | |
| runs-on: ubuntu-latest | |
| needs: lint-test-frontend | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build frontend image | |
| uses: redhat-actions/buildah-build@v2 | |
| with: | |
| context: ./frontend | |
| image: ibutsu-frontend | |
| dockerfiles: | | |
| ./frontend/docker/Dockerfile.frontend |