copy gcno files into dedictated directories #1612
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Integration tests | |
on: | |
push: | |
branches: [main, hirte-*] | |
pull_request: | |
branches: [main, hirte-*] | |
workflow_dispatch: | |
jobs: | |
rpmbuild: | |
runs-on: ubuntu-latest | |
container: | |
image: quay.io/bluechi/build-base:latest | |
env: | |
ARTIFACTS_DIR: exported-artifacts | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: 'true' | |
# Use githash of a tested commit instead of merge commit | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Mark source directory as safe | |
run: | | |
git config --global --add safe.directory $(pwd) | |
- name: Perform build | |
run: | | |
WITH_COVERAGE=1 ./build-scripts/build-rpm.sh $ARTIFACTS_DIR | |
- name: Create DNF repository | |
run: | | |
createrepo_c $ARTIFACTS_DIR | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: rpm-artifacts | |
path: ${{ env.ARTIFACTS_DIR}} | |
test: | |
needs: rpmbuild | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install \ | |
genisoimage \ | |
lcov \ | |
libkrb5-dev \ | |
libvirt-daemon-system \ | |
libvirt-dev \ | |
pkg-config \ | |
podman \ | |
qemu-kvm \ | |
-y | |
- name: Install unpackaged python libraries from PyPi | |
run: | | |
pip install "tmt[provision]" "tmt[report-junit]" podman pytest pytest-timeout | |
# Mitigate https://github.com/containers/podman-py/issues/350 | |
pip install rich | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: rpm-artifacts | |
path: 'tests/bluechi-rpms' | |
- name: Check integration test IDs | |
run: | | |
cd tests | |
tmt test id --dry | grep "New id" && echo "Found integration tests with missing ID. Please generate Test-IDs." && exit 1 | |
cd .. | |
- name: Run integration tests | |
run: | | |
cd tests | |
tmt run -v -eCONTAINER_USED=integration-test-local -eWITH_COVERAGE=1 | |
- name: Show tmt log output in case of failure | |
if: ${{ failure() }} | |
run: | | |
cat /var/tmp/tmt/run-001/log.txt | |
# Extract the collected coverage results if they exist and remove them from | |
# the tmt directory to avoid duplication in artifacts | |
- name: Extract coverage results | |
if: always() | |
run: | | |
MERGE_FILE="/var/tmp/tmt/run-001/plans/tier0/report/default-0/merged.info" | |
COVERAGE_DIR="/var/tmp/tmt/run-001/plans/tier0/report/default-0/report/" | |
if [ -d "$COVERAGE_DIR" ]; then | |
cp -r $COVERAGE_DIR /var/tmp | |
cp $MERGE_FILE /var/tmp | |
rm -rf $COVERAGE_DIR | |
rm -rf $MERGE_FILE | |
fi | |
- name: Upload tmt artifacts | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: tmt-artifacts | |
path: '/var/tmp/tmt' | |
- name: Upload coverage HTML report | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-artifacts-html | |
path: '/var/tmp/report' | |
- name: Upload coverage file | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-artifacts-info | |
path: '/var/tmp/merged.info' | |