forked from dogtagpki/pki
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (75 loc) · 2.54 KB
/
python-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Python Tests
on: [push, pull_request]
jobs:
init:
name: Initializing Workflow
runs-on: ubuntu-latest
container: fedora:latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Set up test matrix
id: set-matrix
run: |
export latest=$(cat /etc/fedora-release | awk '{ print $3 }')
export previous=$(cat /etc/fedora-release | awk '{ print $3 - 1}')
echo "Running CI against Fedora $previous and $latest"
if [ "${{ secrets.MATRIX }}" == "" ]
then
echo "::set-output name=matrix::{\"os\":[\"$previous\", \"$latest\"]}"
else
echo "::set-output name=matrix::${{ secrets.MATRIX }}"
fi
# docs/development/Building_PKI.md
build:
name: Building PKI
needs: init
runs-on: ubuntu-latest
container: registry.fedoraproject.org/fedora:${{ matrix.os }}
env:
COPR_REPO: "@pki/master"
strategy:
matrix: ${{ fromJSON(needs.init.outputs.matrix) }}
steps:
- name: Install git
run: dnf install -y git
- name: Clone repository
uses: actions/checkout@v2
- name: Install dependencies
run: |
dnf install -y dnf-plugins-core rpm-build
dnf copr enable -y $COPR_REPO
dnf builddep -y --allowerasing --spec ./pki.spec --nogpgcheck
- name: Build PKI packages
run: ./build.sh --with-pkgs=base,server,tests --with-timestamp --with-commit-id --work-dir=build rpm
- name: Upload PKI packages
uses: actions/upload-artifact@v2
with:
name: pki-build-${{ matrix.os }}
path: build/RPMS/
pylint-test:
name: pylint
needs: [init, build]
runs-on: ubuntu-latest
env:
COPR_REPO: "@pki/master"
container: registry.fedoraproject.org/fedora:${{ matrix.os }}
strategy:
matrix: ${{ fromJSON(needs.init.outputs.matrix) }}
steps:
- name: Download PKI packages
uses: actions/download-artifact@v2
with:
name: pki-build-${{ matrix.os }}
path: build/RPMS
- name: Update container
run: |
dnf install -y python3-pylint python3-flake8 python3-pyflakes findutils dnf-plugins-core
dnf copr enable -y ${COPR_REPO}
- name: Install PKI packages
run: dnf -y localinstall build/RPMS/*
- name: Run python lint
run: |
/usr/share/pki/tests/bin/pki-lint \
--rcfile=/usr/share/pki/tests/pylintrc \
--config=/usr/share/pki/tests/tox.ini -v