Skip to content

Commit

Permalink
test(action): add testing job
Browse files Browse the repository at this point in the history
  • Loading branch information
timfanda35 committed Sep 24, 2023
1 parent 008ecf0 commit caa238b
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,58 @@ on:
tags:
- v*

# Run tests for any PRs.
# Run tests for merge to main
pull_request:
branches:
- main

env:
# TODO: Change variable to your image's name.
IMAGE_NAME: simple-channel-notify
IMAGE_NAME: weasyprint-api

jobs:
# Testing
testing:
runs-on: ubuntu-latest
if: github.event_name == 'push'

permissions:
contents: read

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.11'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'

- name: Test API
run: |
# Install packages
pip install -r requirement
# Install test packages
pip install httpx pytest
# Run testing
pytest
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
needs: testing

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME
Expand Down

0 comments on commit caa238b

Please sign in to comment.