Skip to content

Commit

Permalink
Add simple GHA workflow to run tests
Browse files Browse the repository at this point in the history
Add simple GHA workflow to run tests
  • Loading branch information
dbogunowicz authored Apr 5, 2024
2 parents d24046a + 021a591 commit 4f606f4
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
Empty file added .github/.gitkeep
Empty file.
41 changes: 41 additions & 0 deletions .github/workflows/test-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Run Tests

on:
push:
branches:
- main
pull_request:
branches:
- main

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 sparsification_config python code was changed"
id: python-check
run: >
((git diff --name-only origin/main HEAD | grep -E "[src|tests]/sparsification_config|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

0 comments on commit 4f606f4

Please sign in to comment.