Skip to content

Commit 54609ab

Browse files
authored
Merge pull request #331 from puppetlabs/CONT-739-Implement_reusable_workflows
2 parents 212c93e + 403ab62 commit 54609ab

File tree

7 files changed

+209
-99
lines changed

7 files changed

+209
-99
lines changed

.github/CODEOWNERS

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

.github/workflows/ci.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: "ci"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "main"
7+
workflow_dispatch:
8+
9+
jobs:
10+
11+
spec:
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
ruby_version:
16+
- '2.5'
17+
- '2.7'
18+
runs_on:
19+
- 'ubuntu-latest'
20+
- 'windows-latest'
21+
22+
name: "Spec : ${{ matrix.runs_on }} Ruby ${{ matrix.ruby_version }}"
23+
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main"
24+
secrets: "inherit"
25+
with:
26+
ruby_version: ${{ matrix.ruby_version }}
27+
runs_on: ${{ matrix.runs_on }}
28+
rake_task: 'gem_revendor test_languageserver test_languageserver_sidecar test_debugserver'
29+
30+
acceptance:
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
ruby_version:
35+
- '2.5'
36+
- '2.7'
37+
runs_on:
38+
- 'ubuntu-latest'
39+
- 'windows-latest'
40+
41+
name: "Acceptance : ${{ matrix.runs_on }} Ruby ${{ matrix.ruby_version }}"
42+
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_acceptance.yml@main"
43+
secrets: "inherit"
44+
with:
45+
ruby_version: ${{ matrix.ruby_version }}
46+
runs_on: ${{ matrix.runs_on }}
47+
rake_task: 'gem_revendor acceptance_languageserver'
48+
49+
build:
50+
name: "Build Editor Service"
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v2
54+
- uses: ruby/setup-ruby@v1
55+
with:
56+
ruby-version: '2.7'
57+
bundler-cache: true
58+
- name: Set build version
59+
shell: pwsh
60+
run: |
61+
'99.99.0-gh.${{ github.run_number }}' | Out-File -FilePath 'lib\puppet_editor_services\VERSION' -Encoding ASCII -Confirm:$false -Force
62+
- name: Run rake gem_revendor build
63+
run: bundle exec rake gem_revendor build
64+
- name: 'Upload Artifact'
65+
uses: actions/upload-artifact@v2
66+
with:
67+
name: puppet-editor-services
68+
path: output/*.zip
69+
retention-days: 2

.github/workflows/editor-services-ci.yml

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

.github/workflows/nightly.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: "nightly"
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
workflow_dispatch:
7+
8+
jobs:
9+
10+
spec:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
ruby_version:
15+
- '2.5'
16+
- '2.7'
17+
runs_on:
18+
- 'ubuntu-latest'
19+
- 'windows-latest'
20+
21+
name: "Spec : ${{ matrix.runs_on }} Ruby ${{ matrix.ruby_version }}"
22+
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main"
23+
secrets: "inherit"
24+
with:
25+
ruby_version: ${{ matrix.ruby_version }}
26+
runs_on: ${{ matrix.runs_on }}
27+
rake_task: 'gem_revendor test_languageserver test_languageserver_sidecar test_debugserver'
28+
29+
acceptance:
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
ruby_version:
34+
- '2.5'
35+
- '2.7'
36+
runs_on:
37+
- 'ubuntu-latest'
38+
- 'windows-latest'
39+
40+
name: "Acceptance : ${{ matrix.runs_on }} Ruby ${{ matrix.ruby_version }}"
41+
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_acceptance.yml@main"
42+
secrets: "inherit"
43+
with:
44+
ruby_version: ${{ matrix.ruby_version }}
45+
runs_on: ${{ matrix.runs_on }}
46+
rake_task: 'gem_revendor acceptance_languageserver'
47+
48+
build:
49+
name: "Build Editor Service"
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v2
53+
- uses: ruby/setup-ruby@v1
54+
with:
55+
ruby-version: '2.7'
56+
bundler-cache: true
57+
- name: Set build version
58+
shell: pwsh
59+
run: |
60+
'99.99.0-gh.${{ github.run_number }}' | Out-File -FilePath 'lib\puppet_editor_services\VERSION' -Encoding ASCII -Confirm:$false -Force
61+
- name: Run rake gem_revendor build
62+
run: bundle exec rake gem_revendor build
63+
- name: 'Upload Artifact'
64+
uses: actions/upload-artifact@v2
65+
with:
66+
name: puppet-editor-services
67+
path: output/*.zip
68+
retention-days: 2

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: "release"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
target:
7+
description: "The target for the release. This can be a commit sha or a branch."
8+
required: false
9+
default: "main"
10+
type: "string"
11+
12+
jobs:
13+
release:
14+
name: "Release"
15+
runs-on: "ubuntu-latest"
16+
if: github.repository_owner == 'puppetlabs'
17+
18+
steps:
19+
20+
- name: "Checkout"
21+
uses: "actions/checkout@v3"
22+
with:
23+
ref: ${{ github.event.inputs.target }}
24+
clean: true
25+
fetch-depth: 0
26+
27+
- name: "Setup ruby"
28+
uses: "ruby/setup-ruby@v1"
29+
with:
30+
ruby-version: "2.7"
31+
bundler-cache: "true"
32+
33+
- name: "Bundle environment"
34+
run: |
35+
echo ::group::bundler environment
36+
bundle env
37+
echo ::endgroup::
38+
- name: "Get version"
39+
id: "get_version"
40+
run: |
41+
echo "version=$(ruby -e "require 'rubygems'; puts Gem::Specification::load(Dir.glob('*.gemspec').first).version.to_s")" >> $GITHUB_OUTPUT
42+
- name: "Build"
43+
run: |
44+
bundle exec rake build
45+
- name: "Create release"
46+
run: |
47+
gh release create v${{ steps.get_version.outputs.version }}
48+
env:
49+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release_prep.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "release prep"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
target:
7+
description: "The target for the release. This can be a commit sha or a branch."
8+
required: false
9+
default: "main"
10+
version:
11+
description: "Version of gem to be released."
12+
required: true
13+
14+
jobs:
15+
release_prep:
16+
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_release_prep.yml@main"
17+
with:
18+
target: "${{ github.event.inputs.target }}"
19+
version: "${{ github.events.inputs.version }}"
20+
secrets: "inherit"

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org"
1111
group :development do
1212
gem 'rake', '>= 10.4', :require => false
1313
gem 'rspec', '>= 3.2', :require => false
14+
gem 'puppet-lint', '~> 3.3', :require => false
15+
gem 'puppetfile-resolver', '~> 0.6.2', :require => false
16+
gem 'yard', '~> 0.9.28', :require => false
1417

1518
gem "rubocop", '= 1.6.1', require: false
1619
gem "rubocop-performance", '= 1.9.1', require: false

0 commit comments

Comments
 (0)