-
Notifications
You must be signed in to change notification settings - Fork 40
52 lines (47 loc) · 1.75 KB
/
sanity-checks.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
name: Ansible Sanity Check
on:
pull_request:
jobs:
sanity:
name: Sanity Check
strategy:
matrix:
ansible:
# 2.9 fails due to https://github.com/ansible/ansible/issues/68819
- stable-2.10
- stable-2.15
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: ${{ matrix.ansible }}/ansible_collections/redhatci/ocp
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.11
- name: Install ansible-base ${{ matrix.ansible }}
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
# Fail when new errors appear
- name: Run sanity test
run: |
set -ex
git checkout -b branch
git fetch --unshallow origin main
git config user.name 'Fake' && git config user.email 'fake@localhost'
git merge origin/main --no-edit
cmd="ansible-test sanity --verbose --color --docker --coverage --failure-ok"
$cmd 2>&1 | tee branch.output
git checkout main
$cmd > main.output 2>&1
for key in branch main; do
grep -E "(ERROR|FATAL):" "$key.output" | \
grep -v "issue(s) which need to be resolved\|See error output above for details." > "$key.errors"
done
set +x
echo "============================================================"
if diff -u main.errors branch.errors|grep '^+'; then
echo "Fix the regressions listed above (starting with a '+')"
exit 1
fi
working-directory: ${{ matrix.ansible }}/ansible_collections/redhatci/ocp