diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml new file mode 100644 index 0000000..0360d18 --- /dev/null +++ b/.github/workflows/run_tests.yml @@ -0,0 +1,19 @@ +name: Run tests +on: + pull_request: + branches: [ master ] +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Create .env file + run: cp development.env .env + + - name: Build docker image + run: docker-compose build + + - name: Run tests in docker container + run: docker-compose run tests-config test diff --git a/README.md b/README.md index e71ea2b..9e49a42 100644 --- a/README.md +++ b/README.md @@ -207,6 +207,19 @@ How to run the tests $ docker-compose build $ docker-compose run tests-config test + +How to setup a development environment +-------------------------------------- + +1. Install [Poetry](https://poetry.eustace.io/docs/). + +2. Create a new [Python](https://docs.python.org/) virtual + environment and activate it. + +3. To install dependencies, run this command: + + $ poetry install + 4. To run the minimal set of services needed for development, use this command: @@ -224,20 +237,7 @@ How to run the tests the RabbitMQ connection URLs accordingly (`PROTOCOL_BROKER_URL` in the *.env* file). - -How to setup a development environment --------------------------------------- - -1. Install [Poetry](https://poetry.eustace.io/docs/). - -2. Create a new [Python](https://docs.python.org/) virtual - environment and activate it. - -3. To install dependencies, run this command: - - $ poetry install - -4. You can use `flask run -p 5000` to run a local web server, and +5. You can use `flask run -p 5000` to run a local web server, and `pytest --cov=swpt_creditors --cov-report=html` to run the tests and generate a test coverage report.