Skip to content

Commit a12b6c5

Browse files
authored
Merge branch 'main' into thor
2 parents 992f060 + 1b61ffc commit a12b6c5

18 files changed

Lines changed: 270 additions & 237 deletions

File tree

.github/actions/presuite.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ def verify_facter_standalone_exits_0
135135
# `documentation` group contains ronn and hpricot
136136
# both gems are ancient, dead upstream, don't compile on modern rubies
137137
# and are only required for building manpages
138-
run('bundle install --without development:documentation')
138+
run('bundle config set --local without "development documentation"')
139+
run('bundle install')
139140
run('bundle exec facter')
140141
end
141142
end

.github/workflows/acceptance_tests.yml

Lines changed: 0 additions & 75 deletions
This file was deleted.

.github/workflows/checks.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
---
2+
name: CI
3+
4+
on:
5+
pull_request: {}
6+
push:
7+
branches:
8+
- main
9+
10+
# minimal permissions
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
rubocop_and_matrix:
16+
runs-on: ubuntu-24.04
17+
outputs:
18+
ruby: ${{ steps.ruby.outputs.versions }}
19+
steps:
20+
- uses: actions/checkout@v6
21+
- name: Install Ruby ${{ matrix.ruby }}
22+
uses: ruby/setup-ruby@v1
23+
with:
24+
ruby-version: "3.4"
25+
bundler-cache: true
26+
- name: Run Rubocop
27+
run: bundle exec rake rubocop
28+
- run: gem build --strict --verbose *.gemspec
29+
- id: ruby
30+
uses: voxpupuli/ruby-version@v2
31+
32+
linux_unit_tests:
33+
needs:
34+
- rubocop_and_matrix
35+
name: Unit tests on Linux with Ruby ${{ matrix.ruby }}
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
40+
include:
41+
- ruby: 'jruby-9.4.12.1'
42+
- ruby: 'jruby-9.4.8.0'
43+
- ruby: 'jruby-10.0.2.0'
44+
runs-on: ubuntu-24.04
45+
steps:
46+
- name: Checkout current PR
47+
uses: actions/checkout@v6
48+
49+
- name: Rspec checks
50+
uses: ruby/setup-ruby@v1
51+
with:
52+
ruby-version: ${{ matrix.ruby }}
53+
bundler-cache: true
54+
- run: bundle exec rake spec_random
55+
56+
windows_unit_tests:
57+
name: Unit tests on Windows with Ruby ${{ matrix.ruby }}
58+
strategy:
59+
matrix:
60+
ruby:
61+
- '2.7'
62+
- '3.2'
63+
runs-on: windows-2025
64+
steps:
65+
- name: Checkout current PR
66+
uses: actions/checkout@v6
67+
68+
- name: Rspec checks
69+
uses: ruby/setup-ruby@v1
70+
with:
71+
ruby-version: ${{ matrix.ruby }}
72+
bundler-cache: true
73+
- run: bundle exec rake spec_random
74+
75+
acceptance_tests:
76+
name: Platform
77+
strategy:
78+
matrix:
79+
os:
80+
- windows-2022
81+
- ubuntu-22.04
82+
- ubuntu-24.04
83+
fail-fast: false
84+
runs-on: ${{ matrix.os }}
85+
env:
86+
BEAKER_debug: true
87+
FACTER_ROOT: facter
88+
RELEASE_STREAM: puppet8
89+
90+
steps:
91+
- name: Checkout current PR
92+
uses: actions/checkout@v6
93+
with:
94+
path: facter
95+
96+
- name: Install Ruby 3.2
97+
uses: ruby/setup-ruby@v1
98+
with:
99+
ruby-version: '3.2'
100+
bundler-cache: true
101+
102+
- name: Fix common Linux and macOS permissions
103+
if: runner.os != 'Windows'
104+
run: sudo chmod a-w /opt
105+
106+
- name: Fix Linux permissions
107+
if: runner.os == 'Linux'
108+
run: |
109+
sudo chmod a-w /home/runner /usr/share &&
110+
sudo chmod -R a-w /home/runner/.config /home/linuxbrew
111+
112+
- name: Install dhclient for Linux
113+
if: runner.os == 'Linux'
114+
run: |
115+
sudo apt install isc-dhcp-client
116+
sudo dhclient
117+
118+
# IPv6 is missing on the GitHub macOS image and we need it for the networking facts tests
119+
# https://github.com/actions/runner-images/issues/668
120+
- name: Add IPv6 on macOS
121+
if: runner.os == 'macOS'
122+
run: |
123+
primary_interface=`route -n get default | awk '/interface: */{print $NF}'`
124+
sudo ifconfig $primary_interface inet6 add ::1/64
125+
126+
- name: Run acceptance tests on Linux and MacOS platform
127+
if: runner.os != 'Windows'
128+
run: sudo -E "PATH=$PATH" ruby $FACTER_ROOT/.github/actions/presuite.rb ${{ matrix.os }}
129+
130+
- name: Run acceptance tests on Windows-like platform
131+
if: runner.os == 'Windows'
132+
run: ruby $Env:FACTER_ROOT/.github/actions/presuite.rb ${{ matrix.os }}
133+
134+
integration_tests:
135+
name: Integration on ${{ matrix.cfg.os }} with Ruby ${{ matrix.cfg.ruby }}
136+
strategy:
137+
fail-fast: false
138+
matrix:
139+
cfg:
140+
- {os: ubuntu-latest, ruby: '2.7'}
141+
- {os: ubuntu-22.04, ruby: '3.2'} # with openssl 3
142+
- {os: ubuntu-22.04, ruby: 'jruby-9.3.14.0'}
143+
- {os: ubuntu-latest, ruby: 'jruby-9.4.8.0'}
144+
- {os: ubuntu-latest, ruby: 'jruby-9.4.12.1'}
145+
- {os: ubuntu-latest, ruby: 'jruby-10.0.2.0'}
146+
- {os: windows-2022, ruby: '2.7'}
147+
- {os: windows-2022, ruby: '3.2'} # with openssl 3
148+
runs-on: ${{ matrix.cfg.os }}
149+
env:
150+
BUNDLE_WITH: 'integration'
151+
steps:
152+
- name: Checkout current PR
153+
uses: actions/checkout@v6
154+
155+
- name: Rspec checks
156+
uses: ruby/setup-ruby@v1
157+
with:
158+
ruby-version: ${{ matrix.cfg.ruby }}
159+
bundler-cache: true
160+
- run: bundle exec rake spec_integration
161+
162+
tests:
163+
if: always()
164+
needs:
165+
- rubocop_and_matrix
166+
- linux_unit_tests
167+
- windows_unit_tests
168+
- acceptance_tests
169+
- integration_tests
170+
runs-on: ubuntu-24.04
171+
name: Test suite
172+
steps:
173+
- name: Decide whether the needed jobs succeeded or failed
174+
uses: re-actors/alls-green@release/v1
175+
with:
176+
jobs: ${{ toJSON(needs) }}

.github/workflows/integration_tests.yaml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/prepare_release.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ on:
44
workflow_dispatch:
55
inputs:
66
version:
7-
description: 'Version to be released.'
8-
required: false
9-
default: ''
7+
description: 'Version to be released (e.g., 8.24.0)'
8+
required: true
109
type: string
1110
base-branch:
1211
description: 'The branch that will be used as the origin for the release branch.'
@@ -20,9 +19,8 @@ jobs:
2019
prepare_release:
2120
uses: OpenVoxProject/shared-actions/.github/workflows/prepare_release.yml@main
2221
with:
23-
allowed_owner: 'OpenVoxProject'
24-
base-branch: ${{ github.event.inputs.base-branch }}
25-
version: ${{ github.event.inputs.version }}
22+
version: ${{ inputs.version }}
23+
base-branch: ${{ inputs.base-branch }}
2624
secrets:
2725
github_pat: ${{ secrets.OPENVOXBOT_COMMIT_AND_PRS }}
2826
ssh_private_key: ${{ secrets.OPENVOXBOT_SSH_PRIVATE_KEY }}

.github/workflows/release.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ on:
44
workflow_dispatch:
55
inputs:
66
version:
7-
description: 'Version to be released.'
8-
required: false
9-
default: ''
7+
description: 'Version to be released'
8+
required: true
109
type: string
1110
base-branch:
1211
description: 'The branch where we do this release.'
@@ -20,9 +19,9 @@ jobs:
2019
release:
2120
uses: OpenVoxProject/shared-actions/.github/workflows/release.yml@main
2221
with:
23-
allowed_owner: 'OpenVoxProject'
24-
base-branch: ${{ github.event.inputs.base-branch }}
25-
version: ${{ github.event.inputs.version }}
22+
version: ${{ inputs.version }}
23+
base-branch: ${{ inputs.base-branch }}
24+
bump_to_rc_after_release: false
2625
secrets:
2726
github_pat: ${{ secrets.OPENVOXBOT_COMMIT_AND_PRS }}
2827
ssh_private_key: ${{ secrets.OPENVOXBOT_SSH_PRIVATE_KEY }}

0 commit comments

Comments
 (0)