Skip to content

Commit

Permalink
ci: run unit tests during pull requests
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Styk <[email protected]>
  • Loading branch information
StykMartin committed Oct 28, 2024
1 parent a424406 commit 37430ec
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/review-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,60 @@ jobs:
# Disable Selenium tests until we have plan for selenium driver + firefox
rm -rf src/bkr/inttest/server/selenium
./run-tests.sh -v ${{ matrix.test-target }}
unit-tests:
runs-on: ubuntu-latest
env:
# https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
container:
image: ${{ matrix.os-target.name }}
strategy:
fail-fast: false
matrix:
test-target:
- Common
- Client
- LabController
os-target:
- name: centos:7
- name: quay.io/centos/centos:stream9
additional_repo: "crb"
steps:
- name: Fixup CentOS repo files
if: matrix.os-target.name == 'centos:7'
run: |
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
- name: Set BKR_PY3 environment variable
run: echo "BKR_PY3=1" >> $GITHUB_ENV
if: matrix.os-target.name != 'centos:7'

- name: Install DNF and plugins
run: yum install -y dnf 'dnf-command(builddep)' 'dnf-command(config-manager)'

- name: Enable additional repositories
run: |
IFS=', ' read -r -a repos <<< "${{ matrix.os-target.additional_repo }}"
for repo in "${repos[@]}"; do
dnf config-manager --set-enabled $repo
done
# Do not upgrade to @v4 as node 20 is incompatible with CentOS 7
- name: Checkout
uses: actions/checkout@v3

- name: Add Beaker Server YUM repository
if: matrix.os-target.name == 'centos:7'
run: |
curl -o /etc/yum.repos.d/beaker-server.repo https://beaker-project.org/yum/beaker-server-RedHatEnterpriseLinux.repo
# Build dependencies must be sufficient, the same is done during RPM build
- name: Install Beaker dependency from specfile
run: |
dnf builddep -y *.spec
- name: Run unit tests
run: |
pushd ${{ matrix.test-target }}
./run-tests.sh

0 comments on commit 37430ec

Please sign in to comment.