client+server: cleanup GitHub actions workflow names

Also run unit test action on push
This commit is contained in:
Shyam Sunder 2021-09-23 12:38:08 -04:00
parent d083084407
commit d699979d35
3 changed files with 21 additions and 18 deletions

View file

@ -1,7 +1,8 @@
name: build-containers
name: Build Docker containers
on: [push]
jobs:
build-client:
name: Build and push client/ Docker container
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
@ -53,6 +54,7 @@ jobs:
./client
build-server:
name: Build and push server/ Docker container
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub

View file

@ -1,16 +1,28 @@
name: run-unit-tests
on: [pull_request]
name: Run unit tests
on: [push, pull_request]
jobs:
test-server:
name: Run pytest for server/
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build test container
run: |
TAG=$(docker build --target testing -q ./server)
echo "image_tag=${TAG}" >> $GITHUB_ENV
run: >
docker buildx build --load
--platform linux/amd64 --target testing
-t test_container
./server
- name: Run unit tests
run: docker run --rm -t ${{ env.image_tag }} --color=no szurubooru/
run: >
docker run --rm -t test_container
--color=no
--cov-report=term-missing:skip-covered
--cov=szurubooru
szurubooru/

View file

@ -83,17 +83,6 @@ repos:
files: server/szurubooru/
exclude: server/szurubooru/migrations/
pass_filenames: false
stages: [push]
- id: pytest-cov
name: pytest
entry: bash -c 'docker run --rm -t $(docker build --target testing -q server/) --cov-report=term-missing:skip-covered --cov=szurubooru szurubooru/'
language: system
types: [python]
files: server/szurubooru/
exclude: server/szurubooru/migrations/
pass_filenames: false
verbose: true
stages: [manual]
fail_fast: true