-
Notifications
You must be signed in to change notification settings - Fork 55
110 lines (92 loc) · 3.7 KB
/
Copy pathdocat.yml
File metadata and controls
110 lines (92 loc) · 3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
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@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4
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]')"