Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 5962b41

Browse files
authored
Condensed test actions (#72)
* Condensed test actions * Updated job depedency
1 parent 14b4e38 commit 5962b41

File tree

3 files changed

+54
-53
lines changed

3 files changed

+54
-53
lines changed

.github/workflows/merge-test.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/pull-request-test.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/test-check.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Test Checks
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
- 'release/*'
7+
push:
8+
branches:
9+
- main
10+
- 'release/*'
11+
12+
jobs:
13+
test-setup:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
python-diff: ${{ steps.python-check.outputs.output }}
17+
full-check: ${{ steps.full-check.outputs.output }}
18+
steps:
19+
- uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0
22+
- name: "Checking if sparsezoo python code was changed"
23+
id: python-check
24+
run: >
25+
((git diff --name-only origin/main HEAD | grep -E "[src|tests]/sparsezoo|setup.py")
26+
|| (echo $GITHUB_REF | grep -E "refs/heads/[release/|main]"))
27+
&& echo "::set-output name=output::1" || echo "::set-output name=output::0"
28+
- name: "Checking if full tests need to run"
29+
id: full-check
30+
run: >
31+
(echo $GITHUB_REF | grep -E "refs/heads/[release/|main]")
32+
&& echo "::set-output name=output::1" || echo "::set-output name=output::0"
33+
python-tests:
34+
runs-on: ubuntu-latest
35+
needs: test-setup
36+
if: ${{needs.test-setup.outputs.python-diff == 1}}
37+
steps:
38+
- uses: actions/checkout@v2
39+
- name: "⚙️ Install dependencies"
40+
run: pip3 install .[dev]
41+
- name: "🔬 Running tests"
42+
run: make test
43+
env:
44+
SPARSEZOO_API_URL: https://staging-api.neuralmagic.com
45+
extensive-python-tests:
46+
runs-on: ubuntu-latest
47+
needs: test-setup
48+
if: ${{needs.test-setup.outputs.full-check == 1}}
49+
steps:
50+
- uses: actions/checkout@v2
51+
- name: "⚙️ Install dependencies"
52+
run: pip3 install .[dev]
53+
- name: "🔬 Running tests"
54+
run: make test TARGETS=full

0 commit comments

Comments
 (0)