client+server: cleanup GitHub actions workflow names
Also run unit test action on push
This commit is contained in:
parent
d083084407
commit
d699979d35
3 changed files with 21 additions and 18 deletions
4
.github/workflows/build-containers.yml
vendored
4
.github/workflows/build-containers.yml
vendored
|
@ -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
|
||||
|
|
24
.github/workflows/run-unit-tests.yml
vendored
24
.github/workflows/run-unit-tests.yml
vendored
|
@ -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/
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue