From 021a591c93843ecb3e6f1e81687bbb9e30e212a4 Mon Sep 17 00:00:00 2001 From: dbogunowicz Date: Wed, 3 Apr 2024 13:03:05 +0000 Subject: [PATCH] initial commit --- .github/.gitkeep | 0 .github/workflows/test-check.yaml | 41 +++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .github/.gitkeep create mode 100644 .github/workflows/test-check.yaml diff --git a/.github/.gitkeep b/.github/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/.github/workflows/test-check.yaml b/.github/workflows/test-check.yaml new file mode 100644 index 00000000..e43402bb --- /dev/null +++ b/.github/workflows/test-check.yaml @@ -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 \ No newline at end of file