Update run-pytests.yml #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: pytests in Docker-compose Actions Workflow | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build the Docker images | |
| run: docker compose build | |
| - name: Create .env file | |
| run: | | |
| echo "STEX_REDIS=redis://redis:6379" >> .env | |
| echo "STEX_DBENGINE=mysql" >> .env | |
| echo "STEX_DBNAME=stexdb_v1" >> .env | |
| echo "STEX_DBUSER=idp" >> .env | |
| echo "STEX_DBPASSW=ChangeIt" >> .env | |
| echo "STEX_DBHOST=mysql" >> .env | |
| echo "STEX_DBPORT=3306" >> .env | |
| echo "STEX_SECRET_KEY=someth1ngNotTr1via!" >> .env | |
| - name: start the Docker containers | |
| run: docker compose --profile testing up -d | |
| - name: Install pytest | |
| run: pip install pytest | |
| - name: Test with pytest | |
| run: pytest client/test_idp.py | |