diff --git a/.github/workflows/merge-test.yaml b/.github/workflows/merge-test.yaml deleted file mode 100644 index 04aa6d0a..00000000 --- a/.github/workflows/merge-test.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: Merge Tests -on: - push: - branches: - - main - - 'release/*' - -jobs: - python-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: "⚙️ Install dependencies" - run: pip3 install .[dev] - - name: "🔬 Running tests" - run: make test - extensive-python-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: "⚙️ Install dependencies" - run: pip3 install .[dev] - - name: "🔬 Running tests" - run: make test TARGETS=full diff --git a/.github/workflows/pull-request-test.yaml b/.github/workflows/pull-request-test.yaml deleted file mode 100644 index a07fb10d..00000000 --- a/.github/workflows/pull-request-test.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: Pull Request Tests -on: pull_request - -jobs: - diff-check: - runs-on: ubuntu-latest - outputs: - python-diff: ${{ steps.python-check.outputs.output }} - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: "Checking if sparsezoo python code was changed" - id: python-check - run: > - (git diff --name-only origin/main HEAD | grep -E "[src|tests]/sparsezoo|setup.py") - && echo "::set-output name=output::1" || echo "::set-output name=output::0" - python-tests: - runs-on: ubuntu-latest - needs: diff-check - if: ${{needs.diff-check.outputs.python-diff == 1}} - steps: - - uses: actions/checkout@v2 - - name: "⚙️ Install dependencies" - run: pip3 install .[dev] - - name: "🔬 Running tests" - run: make test - env: - SPARSEZOO_API_URL: https://staging-api.neuralmagic.com diff --git a/.github/workflows/test-check.yaml b/.github/workflows/test-check.yaml new file mode 100644 index 00000000..ff59e2e0 --- /dev/null +++ b/.github/workflows/test-check.yaml @@ -0,0 +1,54 @@ +name: Test Checks +on: + pull_request: + branches: + - main + - 'release/*' + push: + branches: + - main + - 'release/*' + +jobs: + test-setup: + runs-on: ubuntu-latest + outputs: + python-diff: ${{ steps.python-check.outputs.output }} + full-check: ${{ steps.full-check.outputs.output }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: "Checking if sparsezoo python code was changed" + id: python-check + run: > + ((git diff --name-only origin/main HEAD | grep -E "[src|tests]/sparsezoo|setup.py") + || (echo $GITHUB_REF | grep -E "refs/heads/[release/|main]")) + && echo "::set-output name=output::1" || echo "::set-output name=output::0" + - name: "Checking if full tests need to run" + id: full-check + run: > + (echo $GITHUB_REF | grep -E "refs/heads/[release/|main]") + && echo "::set-output name=output::1" || echo "::set-output name=output::0" + python-tests: + runs-on: ubuntu-latest + needs: test-setup + if: ${{needs.test-setup.outputs.python-diff == 1}} + steps: + - uses: actions/checkout@v2 + - name: "⚙️ Install dependencies" + run: pip3 install .[dev] + - name: "🔬 Running tests" + run: make test + env: + SPARSEZOO_API_URL: https://staging-api.neuralmagic.com + extensive-python-tests: + runs-on: ubuntu-latest + needs: test-setup + if: ${{needs.test-setup.outputs.full-check == 1}} + steps: + - uses: actions/checkout@v2 + - name: "⚙️ Install dependencies" + run: pip3 install .[dev] + - name: "🔬 Running tests" + run: make test TARGETS=full \ No newline at end of file