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] on: [push]
jobs: jobs:
build-client: build-client:
name: Build and push client/ Docker container
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Login to Docker Hub - name: Login to Docker Hub
@ -53,6 +54,7 @@ jobs:
./client ./client
build-server: build-server:
name: Build and push server/ Docker container
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Login to Docker Hub - name: Login to Docker Hub

View file

@ -1,16 +1,28 @@
name: run-unit-tests name: Run unit tests
on: [pull_request] on: [push, pull_request]
jobs: jobs:
test-server: test-server:
name: Run pytest for server/
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build test container - name: Build test container
run: | run: >
TAG=$(docker build --target testing -q ./server) docker buildx build --load
echo "image_tag=${TAG}" >> $GITHUB_ENV --platform linux/amd64 --target testing
-t test_container
./server
- name: Run unit tests - 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/ files: server/szurubooru/
exclude: server/szurubooru/migrations/ exclude: server/szurubooru/migrations/
pass_filenames: false 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] stages: [manual]
fail_fast: true fail_fast: true