Repository navigation
fix: merge every machine's logs in Go MMT.Logs, drop DGX/aggregate pr… #921
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: UnitTest | |
| on: | |
| push: | |
| branches: ["main"] | |
| release: | |
| types: ["created"] | |
| pull_request: | |
| types: [opened, reopened, ready_for_review, synchronize] | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| cpu-unittests: | |
| runs-on: "ubuntu-22.04" | |
| if: github.event.pull_request.draft == false | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13"] | |
| timeout-minutes: 40 | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' # caching pip dependencies | |
| - name: Install dependencies | |
| run: | | |
| pip install -r python/tests/requirements.txt ${{ matrix.extra-installs }} | |
| pip install "./python[serve]" --upgrade | |
| pip list | |
| - name: Tests w/o CLI | |
| working-directory: python/tests | |
| run: | | |
| # NOTE: do not include coverage report here, see: https://github.com/nedbat/coveragepy/issues/1003 | |
| coverage run -m pytest . -vv -s --ignore=cli | |
| env: # the following value is just a dummy since the actual http calls are mocked out | |
| LIGHTNING_API_KEY: dummy-api-key | |
| - name: Statistics | |
| continue-on-error: true | |
| working-directory: python/tests | |
| run: | | |
| coverage report | |
| coverage xml | |
| js-unittests: | |
| runs-on: "ubuntu-22.04" | |
| if: github.event.pull_request.draft == false | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: ["22"] | |
| timeout-minutes: 40 | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Set up Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| cache-dependency-path: js/package-lock.json | |
| - name: Install dependencies | |
| working-directory: js | |
| run: npm ci | |
| - name: Run tests | |
| working-directory: js | |
| run: npm test | |
| go-unittests: | |
| runs-on: "ubuntu-22.04" | |
| if: github.event.pull_request.draft == false | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Go | |
| uses: actions/setup-go@v7 | |
| with: | |
| go-version: "1.23.0" | |
| cache-dependency-path: go/go.sum | |
| - name: Install tparse | |
| run: go install github.com/mfridman/tparse@v0.18.0 | |
| - name: Run tests | |
| working-directory: go | |
| run: | | |
| go test -count=1 -json ./... > test.json || true | |
| cat test.json | "$(go env GOPATH)/bin/tparse" -smallscreen -sort elapsed | |
| guardian-unittest: | |
| runs-on: ubuntu-latest | |
| needs: [cpu-unittests, js-unittests, go-unittests] | |
| if: always() && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) | |
| steps: | |
| - run: | | |
| echo "cpu-unittests: ${{ needs.cpu-unittests.result }}" | |
| echo "js-unittests: ${{ needs.js-unittests.result }}" | |
| echo "go-unittests: ${{ needs.go-unittests.result }}" | |
| - name: failing... | |
| if: needs.cpu-unittests.result == 'failure' || needs.js-unittests.result == 'failure' || needs.go-unittests.result == 'failure' | |
| run: exit 1 | |
| - name: cancelled or skipped... | |
| if: | | |
| contains(fromJSON('["cancelled", "skipped"]'), needs.cpu-unittests.result) || | |
| contains(fromJSON('["cancelled", "skipped"]'), needs.js-unittests.result) || | |
| contains(fromJSON('["cancelled", "skipped"]'), needs.go-unittests.result) | |
| timeout-minutes: 1 | |
| run: sleep 90 |