Skip to content

Commit

Permalink
Prevent pushing commits if the tests are unsuccessful
Browse files Browse the repository at this point in the history
  • Loading branch information
corentinlger committed Feb 16, 2024
1 parent b0c0b16 commit a493899
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: SimulationSandBox CI

name: SimulationSandBox
on:
push:
branches: [ "main" ]
Expand All @@ -18,18 +16,26 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Reformat with black
run: |
black . --diff --color
black .
- name: Test with pytest
run: |
pytest
- name: Prevent push on test failure
if: failure()
run: exit 1

0 comments on commit a493899

Please sign in to comment.