|
| 1 | +name: Build Status |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + tags: |
| 8 | + - v* |
| 9 | + paths-ignore: |
| 10 | + - docs/ |
| 11 | + - AUTHORS |
| 12 | + - CONTRIBUTING.md |
| 13 | + - LICENSE |
| 14 | + - README.md |
| 15 | + pull_request: |
| 16 | + workflow_dispatch: |
| 17 | + |
| 18 | +concurrency: |
| 19 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 20 | + cancel-in-progress: true |
| 21 | + |
| 22 | +permissions: |
| 23 | + checks: write |
| 24 | + pull-requests: write |
| 25 | + |
| 26 | +jobs: |
| 27 | + build: |
| 28 | + runs-on: ${{ matrix.os }} |
| 29 | + |
| 30 | + strategy: |
| 31 | + matrix: |
| 32 | + os: [ubuntu-latest] |
| 33 | + # TODO more later |
| 34 | + # os: [ubuntu-latest, macos-latest, windows-latest] |
| 35 | + python-version: [3.9] |
| 36 | + node-version: [16.x] |
| 37 | + |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v3 |
| 40 | + |
| 41 | + - name: Set up Python ${{ matrix.python-version }} |
| 42 | + uses: actions/setup-python@v4 |
| 43 | + with: |
| 44 | + python-version: ${{ matrix.python-version }} |
| 45 | + cache: "pip" |
| 46 | + cache-dependency-path: "pyproject.toml" |
| 47 | + |
| 48 | + - name: Use Node.js ${{ matrix.node-version }} |
| 49 | + uses: actions/setup-node@v3 |
| 50 | + with: |
| 51 | + node-version: ${{ matrix.node-version }} |
| 52 | + cache: 'yarn' |
| 53 | + cache-dependency-path: yarn.lock |
| 54 | + |
| 55 | + - name: Install yarn |
| 56 | + run: npm install -g yarn |
| 57 | + |
| 58 | + - name: Install dependencies |
| 59 | + run: make develop |
| 60 | + |
| 61 | + - name: Setup Linux testing infra |
| 62 | + run: make setup-infra-ubuntu DOCKER=docker |
| 63 | + if: ${{ matrix.os == 'ubuntu-latest' }} |
| 64 | + |
| 65 | + - name: Setup Mac testing infra |
| 66 | + run: make setup-infra-mac |
| 67 | + if: ${{ matrix.os == 'macos-latest' }} |
| 68 | + |
| 69 | + - name: Setup Windows testing infra |
| 70 | + run: make setup-infra-win |
| 71 | + if: ${{ matrix.os == 'windows-latest' }} |
| 72 | + |
| 73 | + - name: Setup common testing infra |
| 74 | + run: make setup-infra-common |
| 75 | + |
| 76 | + - name: Lint |
| 77 | + run: make lint |
| 78 | + |
| 79 | + - name: Checks |
| 80 | + run: make checks |
| 81 | + if: ${{ matrix.os == 'ubuntu-latest' }} |
| 82 | + |
| 83 | + - name: Test |
| 84 | + run: make tests |
| 85 | + if: ${{ matrix.os == 'ubuntu-latest' }} |
| 86 | + |
| 87 | + - name: Teardown Linux testing infra |
| 88 | + run: make teardown-infra-ubuntu DOCKER=docker |
| 89 | + if: ${{ matrix.os == 'ubuntu-latest' }} |
| 90 | + |
| 91 | + - name: Teardown Mac testing infra |
| 92 | + run: make teardown-infra-mac |
| 93 | + if: ${{ matrix.os == 'macos-latest' }} |
| 94 | + |
| 95 | + - name: Teardown Windows testing infra |
| 96 | + run: make teardown-infra-win |
| 97 | + if: ${{ matrix.os == 'windows-latest' }} |
| 98 | + |
| 99 | + - name: Teardown common testing infra |
| 100 | + run: make teardown-infra-common |
| 101 | + |
| 102 | + - name: Upload test results (Python) |
| 103 | + uses: actions/upload-artifact@v3 |
| 104 | + with: |
| 105 | + name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }} |
| 106 | + path: junit.xml |
| 107 | + if: ${{ always() }} |
| 108 | + |
| 109 | + - name: Upload test results (JS) |
| 110 | + uses: actions/upload-artifact@v3 |
| 111 | + with: |
| 112 | + name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }} |
| 113 | + path: js/junit.xml |
| 114 | + if: ${{ always() }} |
| 115 | + |
| 116 | + - name: Publish Unit Test Results |
| 117 | + uses: EnricoMi/publish-unit-test-result-action@v2 |
| 118 | + with: |
| 119 | + files: | |
| 120 | + **/junit.xml |
| 121 | + if: ${{ matrix.os == 'ubuntu-latest' }} |
| 122 | + |
| 123 | + - name: Upload coverage |
| 124 | + uses: codecov/codecov-action@v3 |
| 125 | + |
| 126 | + - name: Twine check |
| 127 | + run: make dist |
0 commit comments