Merge pull request #937 from docat-org/update/eslint #2814
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: docat ci | |
| on: [push, pull_request] | |
| jobs: | |
| python-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| python-version: ["3.14"] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: install dependencies | |
| working-directory: docat | |
| run: uv sync --locked --all-extras --dev | |
| - name: run backend linter | |
| working-directory: docat | |
| run: | | |
| uv run ruff check | |
| uv run ruff format --check | |
| - name: run backend static code analysis | |
| working-directory: docat | |
| run: | | |
| uv run mypy . | |
| - name: run backend tests | |
| working-directory: docat | |
| run: | | |
| uv run pytest | |
| javascript-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| - name: install JavaScript dependencies | |
| working-directory: web | |
| run: yarn install | |
| - name: building frontend | |
| working-directory: web | |
| run: yarn build | |
| - name: run linter against code | |
| working-directory: web | |
| run: yarn lint | |
| - name: run test suite | |
| working-directory: web | |
| run: yarn test | |
| container-image: | |
| runs-on: ubuntu-latest | |
| needs: [python-test, javascript-test] | |
| strategy: | |
| max-parallel: 2 | |
| matrix: | |
| registry: | |
| - name: ghcr.io | |
| org: ${{ github.repository_owner }} | |
| token: GITHUB_TOKEN | |
| - name: docker.io | |
| org: randombenj | |
| token: DOCKERHUB | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Build Image | |
| run: | | |
| docker build . --build-arg DOCAT_VERSION=$(git describe --tags --always) --tag ${{ matrix.registry.name }}/${{ matrix.registry.org }}/docat:${{ github.sha }} | |
| docker tag ${{ matrix.registry.name }}/${{ matrix.registry.org }}/docat:${{ github.sha }} ${{ matrix.registry.name }}/${{ matrix.registry.org }}/docat:unstable | |
| - name: tag latest and version on release | |
| run: | | |
| docker tag ${{ matrix.registry.name }}/${{ matrix.registry.org }}/docat:${{ github.sha }} ${{ matrix.registry.name }}/${{ matrix.registry.org }}/docat:$(git describe --tags) | |
| docker tag ${{ matrix.registry.name }}/${{ matrix.registry.org }}/docat:${{ github.sha }} ${{ matrix.registry.name }}/${{ matrix.registry.org }}/docat:latest | |
| if: startsWith(github.event.ref, 'refs/tags') | |
| - name: Registry Login | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ matrix.registry.name }} | |
| username: ${{ matrix.registry.org }} | |
| password: ${{ secrets[matrix.registry.token] }} | |
| # Note(Fliiiix): Only login and push on main repo where the secrets are available | |
| if: "!(github.event.pull_request.head.repo.fork || github.actor == 'dependabot[bot]')" | |
| - name: Publish Image | |
| run: | | |
| docker push --all-tags ${{ matrix.registry.name }}/${{ matrix.registry.org }}/docat | |
| if: "!(github.event.pull_request.head.repo.fork || github.actor == 'dependabot[bot]')" |