|
1 |
| -name: Development |
| 1 | +--- |
| 2 | +name: Development Branch Workflow |
2 | 3 |
|
3 | 4 | on:
|
4 |
| - push: |
5 |
| - branches: |
6 |
| - - "main" |
7 |
| - |
8 | 5 | pull_request:
|
9 |
| - branches: |
10 |
| - - "**" |
| 6 | + branches: ["**"] |
11 | 7 |
|
12 | 8 | jobs:
|
| 9 | + quality-checks: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + python: ["3.9", "3.12"] |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + - name: Setup Python |
| 17 | + uses: actions/setup-python@v5 |
| 18 | + with: |
| 19 | + python-version: ${{ matrix.python }} |
| 20 | + - name: Install dependencies |
| 21 | + run: pip install tox |
| 22 | + - name: Run checks (quality, types, and pre-commit) |
| 23 | + run: | |
| 24 | + tox -e quality |
| 25 | + tox -e types |
| 26 | + pre-commit run --all-files |
| 27 | +
|
13 | 28 | unit-tests:
|
14 | 29 | runs-on: ubuntu-latest
|
15 | 30 | strategy:
|
16 | 31 | matrix:
|
17 |
| - python: |
18 |
| - - "3.12" |
19 |
| - - "3.8" |
| 32 | + python: ["3.9", "3.12"] |
20 | 33 | steps:
|
21 | 34 | - uses: actions/checkout@v4
|
22 |
| - - name: Set up Python |
| 35 | + - name: Setup Python |
23 | 36 | uses: actions/setup-python@v5
|
24 | 37 | with:
|
25 | 38 | python-version: ${{ matrix.python }}
|
26 | 39 | - name: Install dependencies
|
27 | 40 | run: |
|
28 | 41 | python -m pip install tox
|
29 |
| - - name: Run unit tests |
| 42 | + - name: Run tests (smoke and sanity) |
30 | 43 | run: |
|
31 | 44 | python -m tox -e test-unit -- -m "smoke or sanity"
|
32 | 45 |
|
33 | 46 | integration-tests:
|
34 | 47 | runs-on: ubuntu-latest
|
35 | 48 | strategy:
|
36 | 49 | matrix:
|
37 |
| - python: ["3.12", "3.8"] |
| 50 | + python: ["3.9", "3.12"] |
38 | 51 | steps:
|
39 | 52 | - uses: actions/checkout@v4
|
40 |
| - - name: Set up Python |
| 53 | + - name: Setup Python |
41 | 54 | uses: actions/setup-python@v5
|
42 | 55 | with:
|
43 | 56 | python-version: ${{ matrix.python }}
|
44 | 57 | - name: Install dependencies
|
45 |
| - run: python -m pip install tox |
46 |
| - - name: Run integration tests |
47 |
| - run: python -m tox -e test-integration -- -m smoke |
| 58 | + run: | |
| 59 | + python -m pip install tox |
| 60 | + - name: Run tests (smoke) |
| 61 | + run: | |
| 62 | + python -m tox -e test-integration -- -m smoke |
48 | 63 |
|
49 | 64 | publish:
|
50 |
| - if: github.event_name == 'pull_request' || github.event_name == 'push' && github.ref == 'refs/heads/main' |
51 |
| - name: Build & Publish the distribution |
52 |
| - needs: [unit-tests, integration-tests, e2e-tests] |
53 | 65 | runs-on: ubuntu-latest
|
54 |
| - steps: |
55 |
| - - uses: actions/checkout@v4 |
56 |
| - - name: Set up Python |
57 |
| - uses: actions/setup-python@v5 |
58 |
| - with: |
59 |
| - python-version: "3.8" |
60 |
| - - name: Build and Publish Candidate Release |
61 |
| - uses: neuralmagic/nm-actions/actions/publish_pypi@main |
62 |
| - with: |
63 |
| - publish_pypi: false |
64 |
| - publish_pypi_internal: true |
65 |
| - build_type: "dev" |
| 66 | + uses: neuralmagic/nm-actions/actions/python-tox-release@main |
| 67 | + with: |
| 68 | + publish_pypi: false |
| 69 | + publish_nm_pypi: true |
| 70 | + build_type: dev |
| 71 | + secrets: |
| 72 | + GCP_PROJECT: ${{ secrets.GCP_PROJECT }} |
| 73 | + GCP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} |
| 74 | + GCP_NM_PYPI_SA: ${{ secrets.GCP_NM_PYPI_SA }} |
| 75 | + NM_PYPI_SA: ${{ secrets.NM_PYPI_SA }} |
| 76 | + PYPI_PUBLIC_USER: ${{ secrets.PYPI_PUBLIC_USER }} |
| 77 | + PYPI_PUBLIC_AUTH: ${{ secrets.PYPI_PUBLIC_AUTH }} |
0 commit comments