Skip to content

Commit ae801e0

Browse files
committed
add GHA test workflow
1 parent 7060ce3 commit ae801e0

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

.github/dependabot.yml

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
--
12
version: 2
23
updates:
34
- package-ecosystem: 'bundler'
45
directory: '/'
56
schedule:
67
interval: 'daily'
8+
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"

.github/workflows/smart-proxy.yml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
name: Foreman Proxy
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches:
8+
- 'develop'
9+
- '*-stable'
10+
11+
env:
12+
BUNDLE_WITHOUT: "development"
13+
14+
concurrency:
15+
group: ${{ github.ref_name }}-${{ github.workflow }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
setup_matrix:
20+
name: Setup matrix
21+
runs-on: ubuntu-24.04
22+
outputs:
23+
matrix: ${{ steps.build_matrix.outputs.matrix }}
24+
steps:
25+
- name: Build test matrix
26+
id: build_matrix
27+
uses: theforeman/gha-matrix-builder@v0
28+
29+
rubocop:
30+
name: Rubocop
31+
needs: setup_matrix
32+
runs-on: ubuntu-24.04
33+
env:
34+
BUNDLE_WITHOUT: bmc:development:dhcp_isc_inotify:dhcp_isc_kqueue:journald:krb5:libvirt:puppetca_token_whitelisting:realm_freeipa:windows
35+
steps:
36+
- uses: actions/checkout@v4
37+
- name: Setup Ruby
38+
uses: ruby/setup-ruby@v1
39+
with:
40+
ruby-version: ${{ fromJson(needs.setup_matrix.outputs.matrix).ruby[0] }}
41+
bundler-cache: true
42+
- name: Run rubocop
43+
run: bundle exec rubocop --parallel --format github
44+
45+
tests:
46+
name: "Test - Ruby ${{ matrix.ruby }}"
47+
runs-on: ubuntu-24.04
48+
needs:
49+
- setup_matrix
50+
- rubocop
51+
strategy:
52+
fail-fast: false
53+
matrix: ${{ fromJson(needs.setup_matrix.outputs.matrix) }}
54+
steps:
55+
- run: sudo apt-get update
56+
- run: sudo apt-get -qq -y install build-essential libcurl4-openssl-dev zlib1g-dev libvirt-dev libsystemd-dev libkrb5-dev
57+
- name: "Check out Foreman Proxy"
58+
uses: actions/checkout@v4
59+
- name: "Set up Ruby ${{ matrix.ruby }}"
60+
uses: ruby/setup-ruby@v1
61+
with:
62+
ruby-version: ${{ matrix.ruby }}
63+
bundler-cache: true
64+
- name: Archive Gemfile.lock
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: Gemfile-ruby-${{ matrix.ruby }}.lock
68+
path: Gemfile.lock
69+
- name: Run rake test
70+
run: bundle exec rake test
71+
72+
result:
73+
if: always()
74+
name: Test suite
75+
runs-on: ubuntu-24.04
76+
needs:
77+
- tests
78+
steps:
79+
- name: Decide whether the needed jobs succeeded or failed
80+
uses: re-actors/alls-green@release/v1
81+
with:
82+
jobs: ${{ toJSON(needs) }}

0 commit comments

Comments
 (0)