Skip to content

Commit

Permalink
ci(#49): add poe-test.yml
Browse files Browse the repository at this point in the history
run `poe test` from this repository's `dev` Docker container. update
the workflow for building images to also run tests

Signed-off-by: Bryant Finney <[email protected]>
  • Loading branch information
bryant-finney committed Dec 23, 2023
1 parent 4669c65 commit 003adc4
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 11 deletions.
35 changes: 24 additions & 11 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,7 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: 🐳 Docker

# run this workflow for...
# - each push to `main`
# - each release tag (starting with `v`)
# - each pull request that changes a relevant file
on:
push:
tags: v*
branches:
- main

pull_request:
paths:
- .github/workflows/docker-build.yml
Expand All @@ -23,6 +14,10 @@ on:
- platforms.yml
- poetry.lock

push:
tags: v*
branches: [main]

# ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

jobs:
Expand All @@ -33,8 +28,8 @@ jobs:
CI_REGISTRY_IMAGE: ghcr.io/${{ github.repository }}
PYTHON_VERSION: "3.11"

permissions:
packages: write
outputs:
version: ${{ steps.meta.outputs.version }}

runs-on: ubuntu-latest

Expand Down Expand Up @@ -115,3 +110,21 @@ jobs:
pull: true
push: true
targets: dev

test:
container:
image: ghcr.io/${{ github.repository }}/dev:${{ needs.build-and-push.outputs.version }}

needs: build-and-push

permissions:
contents: read
packages: read
pull-requests: write

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- run: poetry install
- run: poe test
27 changes: 27 additions & 0 deletions .github/workflows/poe-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 🧪 poe test

on:
pull_request:
paths:
- "**/*.py"
- "*.py"
- .github/workflows/poe-test.yml
- pyproject.toml
- sample-config.yml

jobs:
run:
container:
image: ghcr.io/${{ github.repository }}/dev:main

permissions:
contents: read
packages: read
pull-requests: write

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- run: poetry install
- run: poe test

0 comments on commit 003adc4

Please sign in to comment.