Skip to content

Commit

Permalink
add basic test for all commits/branches/prs
Browse files Browse the repository at this point in the history
  • Loading branch information
dsikka committed Feb 20, 2024
1 parent 28b5812 commit 217312e
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/test-unit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Basic Test Checks
on:
pull_request:
branches:
- '*'
push:
branches:
- '*'

jobs:
test-setup:
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 $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
env:
SPARSEZOO_TEST_MODE: "true"
NM_DISABLE_ANALYTICS: "true"
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

0 comments on commit 217312e

Please sign in to comment.