|
14 | 14 | - 'translations**' |
15 | 15 |
|
16 | 16 | jobs: |
| 17 | + pre-commit: |
| 18 | + name: Linting Checks |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - |
| 22 | + name: Checkout repository |
| 23 | + uses: actions/checkout@v3 |
| 24 | + |
| 25 | + - |
| 26 | + name: Install tools |
| 27 | + uses: actions/setup-python@v4 |
| 28 | + with: |
| 29 | + python-version: "3.9" |
| 30 | + |
| 31 | + - |
| 32 | + name: Check files |
| 33 | + uses: pre-commit/[email protected] |
| 34 | + |
17 | 35 | documentation: |
18 | 36 | name: "Build Documentation" |
19 | 37 | runs-on: ubuntu-20.04 |
| 38 | + needs: |
| 39 | + - pre-commit |
20 | 40 | steps: |
21 | 41 | - |
22 | 42 | name: Checkout |
@@ -47,11 +67,86 @@ jobs: |
47 | 67 | name: documentation |
48 | 68 | path: docs/_build/html/ |
49 | 69 |
|
50 | | - ci-backend: |
51 | | - uses: ./.github/workflows/reusable-ci-backend.yml |
| 70 | + tests-backend: |
| 71 | + name: "Tests (${{ matrix.python-version }})" |
| 72 | + runs-on: ubuntu-20.04 |
| 73 | + needs: |
| 74 | + - pre-commit |
| 75 | + strategy: |
| 76 | + matrix: |
| 77 | + python-version: ['3.8', '3.9', '3.10'] |
| 78 | + fail-fast: false |
| 79 | + steps: |
| 80 | + - |
| 81 | + name: Checkout |
| 82 | + uses: actions/checkout@v3 |
| 83 | + with: |
| 84 | + fetch-depth: 2 |
| 85 | + - |
| 86 | + name: Install pipenv |
| 87 | + run: pipx install pipenv |
| 88 | + - |
| 89 | + name: Set up Python |
| 90 | + uses: actions/setup-python@v4 |
| 91 | + with: |
| 92 | + python-version: "${{ matrix.python-version }}" |
| 93 | + cache: "pipenv" |
| 94 | + cache-dependency-path: 'Pipfile.lock' |
| 95 | + - |
| 96 | + name: Install system dependencies |
| 97 | + run: | |
| 98 | + sudo apt-get update -qq |
| 99 | + sudo apt-get install -qq --no-install-recommends unpaper tesseract-ocr imagemagick ghostscript libzbar0 poppler-utils |
| 100 | + - |
| 101 | + name: Install Python dependencies |
| 102 | + run: | |
| 103 | + pipenv sync --dev |
| 104 | + - |
| 105 | + name: Tests |
| 106 | + run: | |
| 107 | + cd src/ |
| 108 | + pipenv run pytest |
| 109 | + - |
| 110 | + name: Get changed files |
| 111 | + id: changed-files-specific |
| 112 | + uses: tj-actions/changed-files@v24 |
| 113 | + with: |
| 114 | + files: | |
| 115 | + src/** |
| 116 | + - |
| 117 | + name: List all changed files |
| 118 | + run: | |
| 119 | + for file in ${{ steps.changed-files-specific.outputs.all_changed_files }}; do |
| 120 | + echo "${file} was changed" |
| 121 | + done |
| 122 | + - |
| 123 | + name: Publish coverage results |
| 124 | + if: matrix.python-version == '3.9' && steps.changed-files-specific.outputs.any_changed == 'true' |
| 125 | + env: |
| 126 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 127 | + # https://github.com/coveralls-clients/coveralls-python/issues/251 |
| 128 | + run: | |
| 129 | + cd src/ |
| 130 | + pipenv run coveralls --service=github |
52 | 131 |
|
53 | | - ci-frontend: |
54 | | - uses: ./.github/workflows/reusable-ci-frontend.yml |
| 132 | + tests-frontend: |
| 133 | + name: "Tests Frontend" |
| 134 | + runs-on: ubuntu-20.04 |
| 135 | + needs: |
| 136 | + - pre-commit |
| 137 | + strategy: |
| 138 | + matrix: |
| 139 | + node-version: [16.x] |
| 140 | + steps: |
| 141 | + - uses: actions/checkout@v3 |
| 142 | + - |
| 143 | + name: Use Node.js ${{ matrix.node-version }} |
| 144 | + uses: actions/setup-node@v3 |
| 145 | + with: |
| 146 | + node-version: ${{ matrix.node-version }} |
| 147 | + - run: cd src-ui && npm ci |
| 148 | + - run: cd src-ui && npm run test |
| 149 | + - run: cd src-ui && npm run e2e:ci |
55 | 150 |
|
56 | 151 | prepare-docker-build: |
57 | 152 | name: Prepare Docker Pipeline Data |
|
65 | 160 | cancel-in-progress: false |
66 | 161 | needs: |
67 | 162 | - documentation |
68 | | - - ci-backend |
69 | | - - ci-frontend |
| 163 | + - tests-backend |
| 164 | + - tests-frontend |
70 | 165 | steps: |
71 | 166 | - |
72 | 167 | name: Set ghcr repository name |
|
0 commit comments