-
-
Notifications
You must be signed in to change notification settings - Fork 8
112 lines (93 loc) · 3.25 KB
/
testing.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: testing
on:
pull_request:
branches:
- "*"
push:
branches: master
permissions: read-all
jobs:
test_matrix:
name: ${{ matrix.command }} (${{ matrix.python-version}})
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: [3.11]
command: [flake8, pylint, test-docker-image]
steps:
- name: Docker version info
run: |
docker --version
docker --help
docker compose --version
docker compose --help
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
sudo apt-get update
sudo apt-get install libkrb5-dev libxml2-dev libxmlsec1-dev libxmlsec1-openssl
pip install -U pip setuptools wheel
pip install -r devel.txt
- name: Install packages used during container testing
if: matrix.command == 'test-docker-image'
run: |
# remove stock FF package
sudo snap remove firefox
sudo apt-get remove firefox
# used in test scripts
sudo apt-get install git make ldap-utils wrk
# install beakerlib from source it doesn't ship DEB packages
if [ ! -f "/usr/share/beakerlib/beakerlib.sh" ]; then
git clone https://github.com/beakerlib/beakerlib.git
sudo make -C beakerlib/ install
fi
# install Firefox and Geckodriver from Mozilla's DEB repository
# b/c Ubuntu 22.04 and later ships FF via snap package (a container)
# which causes issues with file access from RobotFramework tests
sudo apt-get install software-properties-common
sudo add-apt-repository --yes ppa:mozillateam/ppa
# prioritize the 3rd party repository
sudo tee /etc/apt/preferences.d/mozilla-firefox << EOF
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001
Package: firefox
Pin: version 1:1snap1-0ubuntu2
Pin-Priority: -1
EOF
sudo apt-get install firefox firefox-geckodriver
- name: Login to Quay.io
if: matrix.command == 'test-docker-image'
run: |
echo "${{ secrets.QUAY_PUSH_TOKEN }}" | docker login -u="${{ secrets.QUAY_PUSH_USERNAME }}" --password-stdin quay.io
- name: Build intermediary kiwitcms/kiwi image
if: matrix.command == 'test-docker-image'
run: |
git clone https://github.com/kiwitcms/Kiwi
make -C Kiwi/ docker-image
docker tag kiwitcms/kiwi:latest quay.io/kiwitcms/version:13.4
- name: make ${{ matrix.command }}
run: |
make ${{ matrix.command }}
- name: Logout of Quay.io
if: ${{ always() && matrix.command == 'test-docker-image' }}
run: |
docker logout quay.io
- name: Upload testing artifacts
if: always() && matrix.command == 'test-docker-image'
uses: actions/upload-artifact@v4
with:
name: testing-artifacts
path: |
./*.json
./*.html
./*.log
./wrk-logs-*/
./*docker.log
./*cookies*
./test*.txt