Merge pull request #1324 from alphagov/AM-1256-govuk-frontend-650 #920
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: Deploy to test | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| jobs: | |
| test: | |
| name: Unit tests | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.x | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.12' | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Unit tests | |
| run: | | |
| python3 -m venv venv | |
| source venv/bin/activate | |
| pip install --upgrade pip | |
| pip install -r requirements_for_test.txt | |
| export DB_SECRET="{'dbClusterIdentifier':'none','password':'secret','dbname':'accessibility_monitoring_app','engine':'postgres','port':5432,'host':'localhost','username':'admin'}" | |
| export DB_NAME=bucket-name | |
| export ALLOWED_HOSTS='localhost 127.0.0.1 0.0.0.0' | |
| export SECRET_KEY=1234 | |
| export DEBUG=TRUE | |
| npm i | |
| make static_files_process | |
| make test | |
| int-test: | |
| needs: test | |
| name: Integration tests | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.x | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.12' | |
| - name: Integration tests | |
| run: | | |
| cd stack_tests/integration_tests | |
| docker compose up --abort-on-container-exit | |
| deploy: | |
| needs: int-test | |
| name: Deploy to AWS | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Terraform | |
| uses: hashicorp/setup-terraform@v4 | |
| with: | |
| terraform_version: 1.14.0 | |
| terraform_wrapper: false | |
| - name: Deploy via Terraform | |
| run: | | |
| python terraform_stack/terraform_deploy/terraform_deployment.py \ | |
| --environment test \ | |
| --function up | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_COPILOT }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_COPILOT }} | |
| AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION_COPILOT }} | |
| - name: Smoke tests | |
| run: | | |
| docker compose \ | |
| --file stack_tests/smoke_tests/test-platform.docker-compose.yml \ | |
| up --abort-on-container-exit | |
| docker compose \ | |
| --file stack_tests/smoke_tests_viewer/test-viewer.docker-compose.yml \ | |
| up --abort-on-container-exit | |
| env: | |
| SMOKE_TESTS_USERNAME: ${{ secrets.SMOKE_TESTS_USERNAME }} | |
| SMOKE_TESTS_PASSWORD: ${{ secrets.SMOKE_TESTS_PASSWORD }} |