|
1 | 1 | name: Build |
2 | 2 | on: |
3 | | - workflow_dispatch: |
4 | 3 | push: |
5 | 4 | branches: [ main, dev ] |
6 | 5 | pull_request: |
7 | 6 | branches: [ main, dev ] |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + debug_enabled: |
| 10 | + type: boolean |
| 11 | + description: Run the build with tmate debugging |
| 12 | + required: false |
| 13 | + default: false |
| 14 | + |
8 | 15 | jobs: |
9 | 16 | build: |
10 | | - name: Test |
11 | 17 | runs-on: ubuntu-latest |
| 18 | + |
12 | 19 | strategy: |
13 | 20 | matrix: |
14 | | - python-version: [ 3.7, 3.8, 3.9 ] |
| 21 | + python-version: [ "3.7", "3.8", "3.9", "3.10" ] |
| 22 | + |
15 | 23 | steps: |
16 | | - - uses: actions/checkout@v2 |
| 24 | + - name: Checkout repository |
| 25 | + uses: actions/checkout@v3 |
| 26 | + |
| 27 | + - name: Fetch complete history for all tags and branches |
| 28 | + run: git fetch --prune --unshallow |
| 29 | + |
17 | 30 | - name: Create ArangoDB Docker container |
18 | 31 | run: > |
19 | 32 | docker create --name arango -p 8529:8529 -e ARANGO_ROOT_PASSWORD=passwd |
20 | 33 | arangodb/arangodb:3.7.7 --server.jwt-secret-keyfile=/tmp/keyfile |
| 34 | +
|
21 | 35 | - name: Copy Foxx service zip into ArangoDB Docker container |
22 | 36 | run: docker cp tests/static/service.zip arango:/tmp/service.zip |
| 37 | + |
23 | 38 | - name: Copy keyfile into ArangoDB Docker container |
24 | 39 | run: docker cp tests/static/keyfile arango:/tmp/keyfile |
| 40 | + |
25 | 41 | - name: Start ArangoDB Docker container |
26 | 42 | run: docker start arango |
27 | | - - name: Fetch complete history for all tags and branches |
28 | | - run: git fetch --prune --unshallow |
| 43 | + |
29 | 44 | - name: Set up Python ${{ matrix.python-version }} |
30 | | - uses: actions/setup-python@v2 |
| 45 | + uses: actions/setup-python@v4 |
31 | 46 | with: |
32 | 47 | python-version: ${{ matrix.python-version }} |
33 | | - - name: Setup pip |
34 | | - run: python -m pip install --upgrade pip setuptools wheel |
35 | | - - name: Install packages |
| 48 | + |
| 49 | + - name: Start tmate session |
| 50 | + uses: mxschmitt/action-tmate@v3 |
| 51 | + if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} |
| 52 | + |
| 53 | + - name: Run pre-commit checks |
| 54 | + uses: pre-commit/[email protected] |
| 55 | + |
| 56 | + - name: Install package |
36 | 57 | run: pip install .[dev] |
37 | | - - name: Run black |
38 | | - run: black --check . |
39 | | - - name: Run flake8 |
40 | | - run: flake8 . |
41 | | - - name: Run isort |
42 | | - run: isort --check --profile=black . |
43 | | - - name: Run mypy |
44 | | - run: mypy arango |
45 | | - - name: Run pytest |
| 58 | + |
| 59 | + - name: Run unit tests |
46 | 60 | run: py.test --complete --cov=arango --cov-report=xml |
| 61 | + |
47 | 62 | - name: Run Sphinx doctest |
48 | 63 | run: python -m sphinx -b doctest docs docs/_build |
49 | | - - name: Run Sphinx HTML |
| 64 | + |
| 65 | + - name: Generate Sphinx HTML |
50 | 66 | run: python -m sphinx -b html -W docs docs/_build |
51 | | - - name: Upload coverge to Codecov |
52 | | - uses: codecov/codecov-action@v2 |
| 67 | + |
| 68 | + - name: Upload coverage to Codecov |
| 69 | + uses: codecov/codecov-action@v3 |
53 | 70 | if: matrix.python-version == '3.8' |
54 | 71 | with: |
55 | 72 | fail_ci_if_error: false |
|
0 commit comments