Skip to content

Commit

Permalink
Add Django tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Nov 6, 2024
1 parent fdbdfc8 commit 1a8e67f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runs:
run: |
cd test
cat docker-compose.yml
yq '(.services.app.build.args.IMAGE|="ghcr.io/${{ github.repository_owner }}/${{ inputs.image }}")' docker-compose.yml > tmp.$$.yml && mv tmp.$$.yml docker-compose.yml
yq '(.services.app.build.args.IMAGE|="${{ inputs.image }}")' docker-compose.yml > tmp.$$.yml && mv tmp.$$.yml docker-compose.yml
yq '(.services.app.build.args.IMAGE_TAG|="ghcr.io/${{ github.repository_owner }}/${{ inputs.image-tag }}")' docker-compose.yml > tmp.$$.yml && mv tmp.$$.yml docker-compose.yml
cat docker-compose.yml
PORT=$(yq '(.services.app.ports)' docker-compose.yml | sed -e 's/^\- \(.*\)\:.*$/\1/')
Expand Down
43 changes: 28 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ jobs:
- name: Test
uses: ./.github/actions/test
with:
application-repository: https://github.com/nationalarchives/flask-application-template
application-repository: nationalarchives/flask-application-template
service: app
# image: ghcr.io/${{ github.repository_owner }}/tna-python
image: tna-python
image-tag: ${{ steps.build.outputs.tag }}

Expand All @@ -54,6 +55,7 @@ jobs:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Build and push
# id: build
# uses: ./.github/actions/build
# with:
# image-name: tna-python-root
Expand All @@ -62,20 +64,29 @@ jobs:
# ignore-linting-rules: DL3002,DL3006
# github-token: ${{ secrets.GITHUB_TOKEN }}

# python-django:
# name: Python Django
# needs: python
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Build and push
# uses: ./.github/actions/build
# with:
# image-name: tna-python-django
# base-image: ghcr.io/nationalarchives/tna-python
# docker-context: docker/tna-python-django
# github-token: ${{ secrets.GITHUB_TOKEN }}
python-django:
name: Python Django
# needs: python
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and push
id: build
uses: ./.github/actions/build
with:
image-name: tna-python-django
base-image: ghcr.io/nationalarchives/tna-python
docker-context: docker/tna-python-django
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Test
uses: ./.github/actions/test
with:
application-repository: nationalarchives/django-application-template
service: app
# image: ghcr.io/${{ github.repository_owner }}/tna-python-django
image: tna-python-django
image-tag: ${{ steps.build.outputs.tag }}

# python-django-root:
# name: Python Django (root)
Expand All @@ -85,6 +96,7 @@ jobs:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Build and push
# id: build
# uses: ./.github/actions/build
# with:
# image-name: tna-python-django-root
Expand All @@ -101,6 +113,7 @@ jobs:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Build and push
# id: build
# uses: ./.github/actions/build
# with:
# image-name: tna-python-dev
Expand Down

0 comments on commit 1a8e67f

Please sign in to comment.