generated from theforeman/foreman_plugin_template
-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (71 loc) · 2.36 KB
/
unit_tests.yaml
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
name: Unit tests
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
defaults:
run:
working-directory: /projects/foreman
jobs:
test_ruby:
defaults:
run:
working-directory: /projects/foreman
env:
PGHOST: postgres
PGUSER: foreman
PGPASS: foreman
RAILS_ENV: test
host: postgres
WORKDIR: /projects/foreman
BUNDLE_PATH: vendor/bundle
GIT_COMMITTER_NAME: "gh_actions"
GIT_COMMITTER_EMAIL: "gh_actions@rh_cloud.foreman"
strategy:
fail-fast: false
matrix:
image_version: [6.0.43]
runs-on: ubuntu-latest
container:
image: ghcr.io/theforeman/tfm_plugin_test:${{ matrix.image_version }}
services:
postgres:
image: quay.io/jomitsch/postgres-with-evr
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_USER: foreman
POSTGRES_PASSWORD: foreman
steps:
- name: Checkout foreman_kernel_care repo
uses: actions/checkout@v3
with:
path: ${{ github.workspace }}/projects/foreman_kernel_care
- name: Fix git config
run: |
cp -Rf $GITHUB_WORKSPACE/projects/foreman_kernel_care /projects/
cd /projects/foreman
echo "gemspec :path => '../foreman_kernel_care'" > bundler.d/foreman_kernel_care.local.rb
/usr/bin/entrypoint.sh git config --global user.name $GIT_COMMITTER_NAME
/usr/bin/entrypoint.sh git config --global user.email $GIT_COMMITTER_EMAIL
- name: remove foreman_rh_cloud and dependencies
working-directory: /projects/foreman
run: |
rm bundler.d/foreman_rh_cloud.local.rb
- name: Run tests suite
run: |
cd /projects/foreman
ls -al /usr/bin
/usr/bin/entrypoint.sh chmod +rx /usr/bin/run_tests.sh
/usr/bin/entrypoint.sh touch /usr/bin/setup_env.sh
/usr/bin/entrypoint.sh chmod +rx /usr/bin/setup_env.sh
/usr/bin/entrypoint.sh head -n -10 /usr/bin/run_tests.sh > /usr/bin/setup_env.sh
/usr/bin/entrypoint.sh /usr/bin/setup_env.sh
- name: Run foreman_kernel_care tests
working-directory: /projects/foreman
run: |
/usr/bin/entrypoint.sh bundle exec rake test:foreman_kernel_care