Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add github action for tests #275

Merged
merged 1 commit into from Aug 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/continuous-integration.yaml
@@ -0,0 +1,44 @@
name: Run Tests

on: [push, pull_request]

jobs:
runtests:
runs-on: ubuntu-latest
container: rockylinux:8
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Determine hash for caching key
id: cachekeystep
run: echo "pomcachekey=${{ hashFiles('pom.xml') }}" >> $GITHUB_ENV
- name: set up dependencies
run: |
dnf -y install dnf-plugins-core
dnf config-manager --set-enabled appstream
dnf config-manager --set-enabled powertools
dnf -y install epel-release \
http://yum.quattor.org/devel/quattor-yum-repo-2-1.noarch.rpm
dnf -y install maven perl-Test-Quattor panc libselinux-utils wget perl-Test-Harness
- name: set up template library core from git master
run: |
cd /tmp
# install library core in /tmp, tests need it
wget -O template-library-core-master.tar.gz https://codeload.github.com/quattor/template-library-core/tar.gz/master
tar -xzf template-library-core-master.tar.gz
cd -
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: /tmp/m2
key: ${{ runner.os }}-m2-${{ env.pomcachekey }}
restore-keys: ${{ runner.os }}-m2-
- name: run tests
run: |
mkdir -p /tmp/m2
useradd -m -s /bin/bash quattor
chown -R quattor:quattor . /tmp/m2
runuser --preserve-environment --command "source /usr/bin/mvn_test.sh && mvn_test" quattor
env:
QUATTOR_TEST_TEMPLATE_LIBRARY_CORE: /tmp/template-library-core-master
MVN_ARGS: -Dmaven.repo.local=/tmp/m2