Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Emterry committed Dec 4, 2024
1 parent 1b982f1 commit 6583d0b
Showing 1 changed file with 39 additions and 25 deletions.
64 changes: 39 additions & 25 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
name: 🧪 Test
name: Run tests

on:
pull_request:
Expand All @@ -10,18 +9,12 @@ permissions: {}

jobs:
test:
name: Test
runs-on: [self-hosted, management-ecr]
permissions:
contents: read
env:
LOGS_BUCKET_NAME: moj-analytics-s3-logs
steps:
- name: Checkout
id: checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# - name: Set Up Container Structure Test
# id: setup_container_structure_test
# uses: ministryofjustice/github-actions/setup-container-structure-test@ccf9e3a4a828df1ec741f6c8e6ed9d0acaef3490 # v18.5.0
uses: actions/checkout@v2

- name: Set up Docker Context for Buildx
id: buildx-context
Expand All @@ -34,24 +27,45 @@ jobs:
version: latest
endpoint: builders

- name: Build with Docker Compose
id: build
shell: bash
env:
IMAGE_TAG: ${{ github.sha }}
run: |
make build
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: eu-west-1
role-to-assume: arn:aws:iam::593291632749:role/github-actions-management-ecr
role-duration-seconds: 1200

- name: Run tests
env:
IMAGE_TAG: ${{ github.sha }}
NETWORK: default

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
registries: 593291632749

- name: Prep Tags
id: prep
run: |
make test-python
TAG=noop
if [[ $GITHUB_REF == refs/tags/* ]]; then
TAG=${GITHUB_REF#refs/tags/}
elif [[ $GITHUB_REF == refs/pull/* ]]; then
TAG="sha-${GITHUB_SHA::8}"
elif [ "${{ github.event_name }}" = "push" ]; then
TAG="sha-${GITHUB_SHA::8}"
fi
echo ::set-output name=tag::${TAG}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Build image
run: make build
env:
NETWORK: host
IMAGE_TAG: ${{ steps.prep.outputs.tag }}

- name: Run Python tests (docker-compose)
run: make clean && make test
env:
NETWORK: default
IMAGE_TAG: ${{ steps.prep.outputs.tag }}

- name: Push image
run: make push
env:
IMAGE_TAG: ${{ steps.prep.outputs.tag }}

0 comments on commit 6583d0b

Please sign in to comment.