-
Notifications
You must be signed in to change notification settings - Fork 232
88 lines (79 loc) · 2.6 KB
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
name: 'Lint, Unit & Integration Tests'
"on":
pull_request:
jobs:
lint-unit:
uses: test-kitchen/.github/.github/workflows/lint-unit.yml@main
build-matrix:
name: Build test matrix from test-kitchen config
runs-on: ubuntu-latest
needs: lint-unit
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- name: Discover Windows suites
id: windows
run: |
cat << "EORUBY" | bundle exec ruby >> "$GITHUB_OUTPUT"
require 'inspec'
require 'kitchen'
windows_loader = Kitchen::Loader::YAML.new(project_config: './kitchen.windows.yml')
windows_suites = Kitchen::Config.new(loader: windows_loader).instances.map { |instance| instance.name }
puts "suites=#{windows_suites.to_json}"
EORUBY
- name: Discover Linux suites
id: linux
run: |
cat << "EORUBY" | bundle exec ruby >> "$GITHUB_OUTPUT"
require 'inspec'
require 'kitchen'
linux_loader = Kitchen::Loader::YAML.new(project_config: './kitchen.yml')
linux_suites = Kitchen::Config.new(loader: linux_loader).instances.map { |instance| instance.name }
puts "suites=#{linux_suites.to_json}"
EORUBY
outputs:
windows-suites: ${{ steps.windows.outputs.suites }}
linux-suites: ${{ steps.linux.outputs.suites }}
integration-windows:
name: Windows ${{matrix.suite}}
runs-on: windows-latest
needs:
- build-matrix
strategy:
fail-fast: false
matrix:
suite: ${{ fromJson(needs.build-matrix.outputs.windows-suites) }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- run: bundle exec kitchen test ${{ matrix.suite }} -l debug
integration-linux:
name: Linux ${{matrix.suite}}
runs-on: ubuntu-latest
needs:
- build-matrix
strategy:
fail-fast: false
matrix:
suite: ${{ fromJson(needs.build-matrix.outputs.linux-suites) }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- run: bundle exec kitchen test ${{ matrix.suite }} -l debug