Skip to content

Commit b3f6983

Browse files
committed
(maint) Resuable workflows for unit tests
This commit switches the GitHub Actions workflows for unit tests over to using the reusable workflows in puppetlabs/phoenix-github-actions.
1 parent e78a8eb commit b3f6983

File tree

4 files changed

+18
-163
lines changed

4 files changed

+18
-163
lines changed

.github/workflows/daily_unit_tests_with_nightly_puppet_gem.yaml

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,11 @@ name: '[Daily] Unit Tests with nightly Puppet gem'
44
on:
55
schedule:
66
- cron: '0 5 * * 1-5'
7+
workflow_dispatch:
78

89
jobs:
910
daily_unit_tests_with_nightly_puppet_gem:
10-
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
11-
strategy:
12-
matrix:
13-
os: [ 'ubuntu-20.04', 'macos-latest', 'windows-2022' ]
14-
puppet_version: [ 6, 7 ]
15-
include:
16-
- puppet_version: 6
17-
ruby: 2.5
18-
- puppet_version: 7
19-
ruby: 2.7
20-
21-
- os: 'ubuntu-20.04'
22-
os_type: 'Linux'
23-
env_set_cmd: 'export '
24-
gem_file: 'puppet-latest.gem'
25-
- os: 'macos-latest'
26-
os_type: 'macOS'
27-
env_set_cmd: 'export '
28-
gem_file: 'puppet-latest-universal-darwin.gem'
29-
- os: 'windows-2022'
30-
os_type: 'Windows'
31-
env_set_cmd: '$env:'
32-
gem_file: 'puppet-latest-x64-mingw32.gem'
33-
34-
runs-on: ${{ matrix.os }}
35-
steps:
36-
- name: Checkout code
37-
uses: actions/checkout@v3
38-
39-
- name: Install ruby version ${{ matrix.ruby }}
40-
uses: ruby/setup-ruby@v1
41-
with:
42-
ruby-version: ${{ matrix.ruby }}
43-
44-
- name: Install the latest nightly build of puppet${{ matrix.puppet_version }} gem
45-
run: |
46-
curl https://nightlies.puppet.com/downloads/gems/puppet${{ matrix.puppet_version }}-nightly/${{ matrix.gem_file }} --output puppet.gem --location
47-
gem install puppet.gem -N
48-
49-
- name: Prepare testing environment with bundler
50-
run: |
51-
git config --global core.longpaths true
52-
bundle config set system 'true'
53-
bundle config set --local without 'release'
54-
${{ matrix.env_set_cmd }}PUPPET_GEM_VERSION=$(ruby -e 'puts /puppet\s+\((.+)\)/.match(`gem list -eld puppet`)[1]')
55-
bundle update --jobs 4 --retry 3
56-
57-
- name: Run unit tests
58-
run: bundle exec rake parallel_spec
11+
uses: "puppetlabs/phoenix-github-actions/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml@main"
5912

6013
notify-via-slack:
6114
name: Notify workflow conclusion via Slack

.github/workflows/unit_tests.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Unit Tests
3+
4+
on:
5+
push:
6+
branches: [ main ]
7+
pull_request:
8+
branches: [ main ]
9+
workflow_dispatch:
10+
11+
jobs:
12+
Nightly:
13+
uses: "puppetlabs/phoenix-github-actions/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml@main"
14+
15+
Released:
16+
uses: "puppetlabs/phoenix-github-actions/.github/workflows/unit_tests_with_released_puppet_gem.yaml@main"

.github/workflows/unit_tests_with_nightly_puppet_gem.yaml

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

.github/workflows/unit_tests_with_released_puppet_gem.yaml

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

0 commit comments

Comments
 (0)