Skip to content

Commit

Permalink
(MAINT) Stop running CI on draft PRs)
Browse files Browse the repository at this point in the history
  • Loading branch information
CoMfUcIoS committed Nov 21, 2023
1 parent 89602e3 commit 0b50847
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 58 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ on:

jobs:
Spec:
if: ${{ github.repository_owner == 'puppetlabs' }}
if: ${{ github.repository_owner == 'puppetlabs' }} && ${{ github.event.pull_request.draft == false }}
uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
secrets: "inherit"

Acceptance:
if: ${{ github.repository_owner == 'puppetlabs' }}
needs: Spec
if: ${{ github.repository_owner == 'puppetlabs' }} && ${{ github.event.pull_request.draft == false }}
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
with:
flags: "--provision-service"
Expand Down
46 changes: 23 additions & 23 deletions .github/workflows/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,33 @@ name: "Spec Tests"

on:
schedule:
- cron: '0 0 * * *'
- cron: "0 0 * * *"
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/**/*'
- 'spec/**/*'
- 'lib/**/*'
- 'tasks/**/*'
- 'functions/**/*'
- 'types/**/*'
- 'plans/**/*'
- 'hiera/**/*'
- 'manifests/**/*'
- 'templates/**/*'
- 'files/**/*'
- 'metadata.json'
- 'Rakefile'
- 'Gemfile'
- 'provision.yaml'
- '.rspec'
- '.rubocop.yml'
- '.puppet-lint.rc'
- '.fixtures.yml'
- ".github/workflows/**/*"
- "spec/**/*"
- "lib/**/*"
- "tasks/**/*"
- "functions/**/*"
- "types/**/*"
- "plans/**/*"
- "hiera/**/*"
- "manifests/**/*"
- "templates/**/*"
- "files/**/*"
- "metadata.json"
- "Rakefile"
- "Gemfile"
- "provision.yaml"
- ".rspec"
- ".rubocop.yml"
- ".puppet-lint.rc"
- ".fixtures.yml"

jobs:
setup_matrix:
if: ${{ github.event.pull_request.draft == false }}
name: "Setup Test Matrix"
runs-on: ubuntu-20.04
outputs:
Expand Down Expand Up @@ -70,7 +71,7 @@ jobs:
name: "Spec Tests (Puppet: ${{matrix.puppet_version}}, Ruby Ver: ${{matrix.ruby_version}})"
needs:
- setup_matrix
if: ${{ needs.setup_matrix.outputs.spec_matrix != '{}' }}
if: ${{ needs.setup_matrix.outputs.spec_matrix != '{}' }} && ${{ github.event.pull_request.draft == false }}

runs-on: ubuntu-20.04
strategy:
Expand All @@ -79,7 +80,7 @@ jobs:

env:
PUPPET_GEM_VERSION: ${{ matrix.puppet_version }}
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main'
FACTER_GEM_VERSION: "https://github.com/puppetlabs/facter#main"

steps:
- run: |
Expand All @@ -100,7 +101,6 @@ jobs:
bundle env
echo ::endgroup::
- name: Run parallel_spec tests
run: |
bundle exec rake parallel_spec
1 change: 1 addition & 0 deletions .github/workflows/test-fips-install-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:

jobs:
test-install:
if: ${{ github.event.pull_request.draft == false }}
name: "PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} with fips ${{ matrix.fips }}"
runs-on: ubuntu-20.04
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-install-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:

jobs:
test-install:
if: ${{ github.event.pull_request.draft == false }}
name: "PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }}"
runs-on: ubuntu-20.04
env:
Expand Down
65 changes: 33 additions & 32 deletions .github/workflows/test-upgrade-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,55 @@ name: "Upgrade test matrix"
on:
pull_request:
paths:
- '.github/workflows/**/*'
- 'spec/**/*'
- 'lib/**/*'
- 'tasks/**/*'
- 'functions/**/*'
- 'types/**/*'
- 'plans/**/*'
- 'hiera/**/*'
- 'manifests/**/*'
- 'templates/**/*'
- 'files/**/*'
- 'metadata.json'
- 'Rakefile'
- 'Gemfile'
- 'provision.yaml'
- '.rspec'
- '.rubocop.yml'
- '.puppet-lint.rc'
- '.fixtures.yml'
- ".github/workflows/**/*"
- "spec/**/*"
- "lib/**/*"
- "tasks/**/*"
- "functions/**/*"
- "types/**/*"
- "plans/**/*"
- "hiera/**/*"
- "manifests/**/*"
- "templates/**/*"
- "files/**/*"
- "metadata.json"
- "Rakefile"
- "Gemfile"
- "provision.yaml"
- ".rspec"
- ".rubocop.yml"
- ".puppet-lint.rc"
- ".fixtures.yml"

branches: [main]
workflow_dispatch: {}

jobs:
test-upgrade:
if: ${{ github.event.pull_request.draft == false }}
name: "PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }}"
runs-on: ubuntu-20.04
env:
BOLT_GEM: true
BOLT_DISABLE_ANALYTICS: true
LANG: 'en_US.UTF-8'
LANG: "en_US.UTF-8"
strategy:
fail-fast: false
matrix:
architecture:
- 'standard'
- 'extra-large-with-dr'
- "standard"
- "extra-large-with-dr"
version:
- '2019.8.12'
- "2019.8.12"
version_to_upgrade:
- '2021.7.4'
- "2021.7.4"
image:
- 'almalinux-cloud/almalinux-8'
- "almalinux-cloud/almalinux-8"
download_mode:
- 'direct'
- "direct"

steps:
- name: 'Start SSH session'
- name: "Start SSH session"
if: ${{ github.event.inputs.ssh-debugging == 'true' }}
uses: luchihoratiu/debug-via-ssh@main
with:
Expand All @@ -74,7 +75,7 @@ jobs:
bundle env
echo ::endgroup::
- name: 'Provision test cluster'
- name: "Provision test cluster"
timeout-minutes: 15
run: |
echo ::group::prepare
Expand All @@ -101,7 +102,7 @@ jobs:
sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true
echo ::endgroup::
- name: 'Install PE on test cluster'
- name: "Install PE on test cluster"
timeout-minutes: 120
run: |
bundle exec bolt plan run peadm_spec::install_test_cluster \
Expand All @@ -110,7 +111,7 @@ jobs:
architecture=${{ matrix.architecture }} \
version=${{ matrix.version }}
- name: 'Wait as long as the file ${HOME}/pause file is present'
- name: "Wait as long as the file ${HOME}/pause file is present"
if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }}
run: |
while [ -f "${HOME}/pause" ] ; do
Expand All @@ -119,7 +120,7 @@ jobs:
done
echo "${HOME}/pause absent, continuing workflow."
- name: 'Upgrade PE on test cluster'
- name: "Upgrade PE on test cluster"
timeout-minutes: 120
run: |
bundle exec bolt plan run peadm_spec::upgrade_test_cluster \
Expand All @@ -129,7 +130,7 @@ jobs:
download_mode=${{ matrix.download_mode }} \
version=${{ matrix.version_to_upgrade }}
- name: 'Tear down test cluster'
- name: "Tear down test cluster"
if: ${{ always() }}
continue-on-error: true
run: |
Expand Down

0 comments on commit 0b50847

Please sign in to comment.