Skip to content

Commit 88187d0

Browse files
committed
Working on having template tests run automatically.
1 parent 1b4e2c8 commit 88187d0

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed

.github/workflows/templates.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7+
8+
name: Test job templates
9+
10+
on:
11+
push:
12+
branches: [ "main" ]
13+
paths:
14+
- 'jobs/*/templates/**'
15+
- 'spec'
16+
- '.github/workflows/templates.yml'
17+
pull_request:
18+
branches: [ "main" ]
19+
paths:
20+
- 'jobs/*/templates/**'
21+
- 'spec'
22+
- '.github/workflows/templates.yml'
23+
24+
permissions:
25+
contents: read
26+
27+
defaults:
28+
run:
29+
working-directory: spec
30+
31+
jobs:
32+
test:
33+
34+
runs-on: ubuntu-latest
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- name: Set up Ruby
40+
uses: ruby/setup-ruby@v1
41+
with:
42+
working-directory: spec
43+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
44+
- name: Run tests
45+
run: |
46+
cat Gemfile
47+
bundle install
48+
gem install bosh-template
49+
gem install rspec
50+
rspec dns-publisher-config_spec.rb

spec/.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.2.3

spec/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
source "https://rubygems.org"
2-
ruby '3.2.3'
2+
ruby File.read('.ruby-version').strip
33
gem 'bosh-template'

0 commit comments

Comments
 (0)