Run unit tests in GitHub Actions

Rename `lint.yml` to `tests.yml` to allow us to put more jobs under the
same test name.

Signed-off-by: Major Hayden <major@redhat.com>
This commit is contained in:
Major Hayden 2020-02-24 13:45:11 -06:00 committed by Tom Gundersen
parent 9d0f6bd85e
commit 4c92b7a28b

51
.github/workflows/tests.yml vendored Normal file
View file

@ -0,0 +1,51 @@
name: Tests
# NOTE(mhayden): Restricting branches prevents jobs from being doubled since
# a push to a pull request triggers two events.
on:
pull_request:
branches:
- "*"
push:
branches:
- master
jobs:
pylint:
name: "pylint"
runs-on: ubuntu-latest
container:
image: docker.io/library/python:3.7
steps:
- name: Install pylint
run: pip install pylint==2.4.1
- name: Clone repository
uses: actions/checkout@v2
with:
path: osbuild
- name: Run pylint
run: |
cd osbuild
pylint osbuild runners/* assemblers/* stages/* sources/*
unit_tests:
name: "unit"
runs-on: ubuntu-latest
container:
image: docker.io/library/python:3.7
steps:
- name: Clone repository
uses: actions/checkout@v2
with:
path: osbuild
- name: Run test_osbuild
run: |
cd osbuild
python3 -m unittest -v test.test_osbuild
- name: Run test_objectstore
run: |
cd osbuild
python3 -m unittest -v test.test_objectstore