Inherit secrets in pull request workflow #10
Workflow file for this run
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: Run tests | |
| on: | |
| workflow_dispatch: | |
| workflow_call: | |
| push: | |
| branches: | |
| - 'enable-tests' | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| env: | |
| ELASTIC_PASSWORD: "changeme" | |
| ELASTIC7_HOST: "localhost" | |
| ELASTIC7_PORT: "9200" | |
| DB_HOST: 127.0.0.1 | |
| AWS_REGION: ${{ secrets.AWS_REGION }} | |
| GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| LAUNCH_DARKLY_KEY: ${{ secrets.LAUNCH_DARKLY_KEY_DEV }} | |
| TEST_DATA_DUMP_FILE: ${{ vars.TEST_DATA_DUMP_FILE }} | |
| services: | |
| elasticsearch7: | |
| image: docker.elastic.co/elasticsearch/elasticsearch:7.10.0 | |
| env: | |
| discovery.type: single-node | |
| ES_JAVA_OPTS: -Xms512m -Xmx512m | |
| ELASTIC_PASSWORD: changeme | |
| xpack.security.enabled: "false" | |
| http.cors.enabled: "true" | |
| http.cors.allow-origin: "*" | |
| ports: | |
| - 9200:9200 | |
| db: | |
| image: mysql:8.0 | |
| env: | |
| MYSQL_DATABASE: "rorapi" | |
| MYSQL_USER: "ror_user" | |
| MYSQL_PASSWORD: "password" | |
| MYSQL_ROOT_PASSWORD: "password" | |
| ports: | |
| - 3306:3306 | |
| options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| steps: | |
| - name: Checkout ror-api code | |
| uses: actions/checkout@v2 | |
| with: | |
| path: ror-api | |
| - name: Set up Python environment | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.8" | |
| cache: "pip" | |
| - name: Install requirements | |
| working-directory: ./ror-api | |
| run: | | |
| # python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install yapf | |
| python manage.py collectstatic --noinput | |
| - name: Load test data | |
| working-directory: ./ror-api | |
| run: | | |
| python manage.py setup ${{ env.TEST_DATA_DUMP_FILE }} -t | |
| - name: Run Tests | |
| working-directory: ./ror-api | |
| run: | | |
| python manage.py test rorapi.tests.tests_unit | |
| # TODO fix these tests running in GitHub Action | |
| # python manage.py test rorapi.tests_integration | |
| # python manage.py test rorapi.tests_functional |