diff --git a/.github/workflows/GitHub_tests.yml b/.github/workflows/GitHub_tests.yml new file mode 100644 index 0000000..5294464 --- /dev/null +++ b/.github/workflows/GitHub_tests.yml @@ -0,0 +1,40 @@ +name: Run Tests + +on: + pull_request: + types: + - opened + - synchronize + push: + branches: + - main + - sparkx_devel + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run tests + run: | + python -m pytest tests/ + + - name: Check test results + run: | + if [ $? -ne 0 ]; then + echo "Tests failed. Blocking pull request merge." + exit 1 + fi \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dac48f..601c309 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,7 +28,7 @@ A `Deprecated` section could be added if needed for soon-to-be removed features. * Lattice3D: Add covariant smearing of densities for particles * Oscar: Add spacetime cut * Particle: Add strangeness, spin and spin_degeneracy functions -* Tests: Add tests for the Particle class +* Tests: Add automatic tests for the Particle class * GenerateFlow: Add functionality to generate flow with k-particle correlations * LeeYangZeroFlow: Add beta version of integrated and differential flow analysis with the Lee-Yang zero method * QCumulantFlow: Add beta version of integrated flow analysis with the Q-Cumulant method