aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hashizume <michael.hashizume@puppet.com>2023-04-19 10:43:55 -0700
committerMichael Hashizume <michael.hashizume@puppet.com>2023-04-19 10:43:55 -0700
commit6ef1ad3d98a1b3289c6ee44d4ceb078c4956bef2 (patch)
tree38649db049a9077df5f14b0a7273bb97e5418d95
parent2d259be6b15564f10ea43e7a65d1a26e744d6767 (diff)
downloadpuppet-cron_core-6ef1ad3d98a1b3289c6ee44d4ceb078c4956bef2.tar.gz
puppet-cron_core-6ef1ad3d98a1b3289c6ee44d4ceb078c4956bef2.tar.bz2
(MODULES-11418) Add unit test resuable workflows
This commit switches the GitHub Actions workflows for unit tests over to using the reusable workflows in puppetlabs/phoenix-github-actions.
-rw-r--r--.github/workflows/daily_unit_tests_with_nightly_puppet_gem.yaml51
-rw-r--r--.github/workflows/unit_tests.yaml16
-rw-r--r--.github/workflows/unit_tests_with_nightly_puppet_gem.yaml60
-rw-r--r--.github/workflows/unit_tests_with_released_puppet_gem.yaml50
4 files changed, 18 insertions, 159 deletions
diff --git a/.github/workflows/daily_unit_tests_with_nightly_puppet_gem.yaml b/.github/workflows/daily_unit_tests_with_nightly_puppet_gem.yaml
index 6579eff..7d3c187 100644
--- a/.github/workflows/daily_unit_tests_with_nightly_puppet_gem.yaml
+++ b/.github/workflows/daily_unit_tests_with_nightly_puppet_gem.yaml
@@ -4,58 +4,11 @@ name: '[Daily] Unit Tests with nightly Puppet gem'
on:
schedule:
- cron: '0 5 * * 1-5'
+ workflow_dispatch:
jobs:
daily_unit_tests_with_nightly_puppet_gem:
- name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
- strategy:
- matrix:
- os: [ 'ubuntu-20.04', 'macos-latest', 'windows-2019' ]
- puppet_version: [ 6, 7 ]
- include:
- - puppet_version: 6
- ruby: 2.5
- - puppet_version: 7
- ruby: 2.7
-
- - os: 'ubuntu-20.04'
- os_type: 'Linux'
- env_set_cmd: 'export '
- gem_file: 'puppet-latest.gem'
- - os: 'macos-latest'
- os_type: 'macOS'
- env_set_cmd: 'export '
- gem_file: 'puppet-latest-universal-darwin.gem'
- - os: 'windows-2019'
- os_type: 'Windows'
- env_set_cmd: '$env:'
- gem_file: 'puppet-latest-x64-mingw32.gem'
-
- runs-on: ${{ matrix.os }}
- steps:
- - name: Checkout code
- uses: actions/checkout@v3
-
- - name: Install ruby version ${{ matrix.ruby }}
- uses: ruby/setup-ruby@v1
- with:
- ruby-version: ${{ matrix.ruby }}
-
- - name: Install the latest nightly build of puppet${{ matrix.puppet_version }} gem
- run: |
- curl https://nightlies.puppet.com/downloads/gems/puppet${{ matrix.puppet_version }}-nightly/${{ matrix.gem_file }} --output puppet.gem --location
- gem install puppet.gem -N
-
- - name: Prepare testing environment with bundler
- run: |
- git config --global core.longpaths true
- bundle config set system 'true'
- bundle config set --local without 'release'
- ${{ matrix.env_set_cmd }}PUPPET_GEM_VERSION=$(ruby -e 'puts /puppet\s+\((.+)\)/.match(`gem list -eld puppet`)[1]')
- bundle update --jobs 4 --retry 3
-
- - name: Run unit tests
- run: bundle exec rake parallel_spec
+ uses: "puppetlabs/phoenix-github-actions/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml@main"
notify-via-slack:
name: Notify workflow conclusion via Slack
diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml
new file mode 100644
index 0000000..81a0f34
--- /dev/null
+++ b/.github/workflows/unit_tests.yaml
@@ -0,0 +1,16 @@
+---
+name: Unit Tests
+
+on:
+ push:
+ branches: [ main ]
+ pull_request:
+ branches: [ main ]
+ workflow_dispatch:
+
+jobs:
+ Nightly:
+ uses: "puppetlabs/phoenix-github-actions/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml@main"
+
+ Released:
+ uses: "puppetlabs/phoenix-github-actions/.github/workflows/unit_tests_with_released_puppet_gem.yaml@main"
diff --git a/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml b/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml
deleted file mode 100644
index 6a9d703..0000000
--- a/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml
+++ /dev/null
@@ -1,60 +0,0 @@
----
-name: Unit Tests with nightly Puppet gem
-
-on:
- push:
- branches: [ main ]
- pull_request:
- branches: [ main ]
-
-jobs:
- unit_tests_with_nightly_puppet_gem:
- name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
- strategy:
- matrix:
- os: [ 'ubuntu-20.04', 'macos-latest', 'windows-2019' ]
- puppet_version: [ 6, 7 ]
- include:
- - puppet_version: 6
- ruby: 2.5
- - puppet_version: 7
- ruby: 2.7
-
- - os: 'ubuntu-20.04'
- os_type: 'Linux'
- env_set_cmd: 'export '
- gem_file: 'puppet-latest.gem'
- - os: 'macos-latest'
- os_type: 'macOS'
- env_set_cmd: 'export '
- gem_file: 'puppet-latest-universal-darwin.gem'
- - os: 'windows-2019'
- os_type: 'Windows'
- env_set_cmd: '$env:'
- gem_file: 'puppet-latest-x64-mingw32.gem'
-
- runs-on: ${{ matrix.os }}
- steps:
- - name: Checkout current PR code
- uses: actions/checkout@v3
-
- - name: Install ruby version ${{ matrix.ruby }}
- uses: ruby/setup-ruby@v1
- with:
- ruby-version: ${{ matrix.ruby }}
-
- - name: Install the latest nightly build of puppet${{ matrix.puppet_version }} gem
- run: |
- curl https://nightlies.puppet.com/downloads/gems/puppet${{ matrix.puppet_version }}-nightly/${{ matrix.gem_file }} --output puppet.gem --location
- gem install puppet.gem -N
-
- - name: Prepare testing environment with bundler
- run: |
- git config --global core.longpaths true
- bundle config set system 'true'
- bundle config set --local without 'release'
- ${{ matrix.env_set_cmd }}PUPPET_GEM_VERSION=$(ruby -e 'puts /puppet\s+\((.+)\)/.match(`gem list -eld puppet`)[1]')
- bundle update --jobs 4 --retry 3
-
- - name: Run unit tests
- run: bundle exec rake parallel_spec
diff --git a/.github/workflows/unit_tests_with_released_puppet_gem.yaml b/.github/workflows/unit_tests_with_released_puppet_gem.yaml
deleted file mode 100644
index 8b5afcb..0000000
--- a/.github/workflows/unit_tests_with_released_puppet_gem.yaml
+++ /dev/null
@@ -1,50 +0,0 @@
----
-name: Unit Tests with released Puppet gem
-
-on:
- push:
- branches: [ main ]
- pull_request:
- branches: [ main ]
-
-jobs:
- unit_tests_with_released_puppet_gem:
- name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
- strategy:
- matrix:
- os: [ 'ubuntu-20.04', 'macos-latest', 'windows-2019' ]
- puppet_version: [ 6, 7 ]
- include:
- - puppet_version: 6
- ruby: 2.5
- - puppet_version: 7
- ruby: 2.7
-
- - os: 'ubuntu-20.04'
- os_type: 'Linux'
- - os: 'macos-latest'
- os_type: 'macOS'
- - os: 'windows-2019'
- os_type: 'Windows'
-
- runs-on: ${{ matrix.os }}
- env:
- PUPPET_GEM_VERSION: ~> ${{ matrix.puppet_version }}.0
- steps:
- - name: Checkout current PR code
- uses: actions/checkout@v3
-
- - name: Install ruby version ${{ matrix.ruby }}
- uses: ruby/setup-ruby@v1
- with:
- ruby-version: ${{ matrix.ruby }}
-
- - name: Prepare testing environment with bundler
- run: |
- git config --global core.longpaths true
- bundle config set system 'true'
- bundle config set --local without 'release'
- bundle update --jobs 4 --retry 3
-
- - name: Run unit tests
- run: bundle exec rake parallel_spec