|
8 | 8 | lint-unit:
|
9 | 9 | uses: test-kitchen/.github/.github/workflows/lint-unit.yml@main
|
10 | 10 |
|
11 |
| - integration-windows: |
12 |
| - name: Windows ${{matrix.suite}} ${{matrix.os}} |
13 |
| - runs-on: windows-latest |
| 11 | + build-matrix: |
| 12 | + name: Build test matrix from test-kitchen config |
| 13 | + runs-on: ubuntu-latest |
14 | 14 | needs: lint-unit
|
15 |
| - strategy: |
16 |
| - fail-fast: false |
17 |
| - matrix: |
18 |
| - suite: [default] |
19 |
| - os: [ubuntu-24.04] |
20 |
| - ruby: ["3.3"] |
21 | 15 | steps:
|
22 | 16 | - uses: actions/checkout@v4
|
23 |
| - - uses: ruby/setup-ruby@v1 |
| 17 | + - name: Set up Ruby |
| 18 | + uses: ruby/setup-ruby@v1 |
24 | 19 | with:
|
25 |
| - ruby-version: ${{ matrix.ruby }} |
| 20 | + ruby-version: "3.3" |
26 | 21 | bundler-cache: true
|
27 |
| - - name: Set up Docker Buildx |
28 |
| - uses: docker/setup-buildx-action@v3 |
29 |
| - - run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }} -l debug |
| 22 | + - name: Discover Windows suites |
| 23 | + id: windows |
| 24 | + run: | |
| 25 | + cat << "EORUBY" | bundle exec ruby >> "$GITHUB_OUTPUT" |
| 26 | + require 'inspec' |
| 27 | + require 'kitchen' |
30 | 28 |
|
31 |
| - integration-linux: |
32 |
| - name: Linux ${{matrix.suite}} ${{matrix.os}} |
33 |
| - runs-on: ubuntu-latest |
34 |
| - needs: lint-unit |
| 29 | + windows_loader = Kitchen::Loader::YAML.new(project_config: './kitchen.windows.yml') |
| 30 | + windows_suites = Kitchen::Config.new(loader: windows_loader).instances.map { |instance| instance.name } |
| 31 | +
|
| 32 | + puts "suites=#{windows_suites.to_json}" |
| 33 | + EORUBY |
| 34 | + - name: Discover Linux suites |
| 35 | + id: linux |
| 36 | + run: | |
| 37 | + cat << "EORUBY" | bundle exec ruby >> "$GITHUB_OUTPUT" |
| 38 | + require 'inspec' |
| 39 | + require 'kitchen' |
| 40 | +
|
| 41 | + linux_loader = Kitchen::Loader::YAML.new(project_config: './kitchen.yml') |
| 42 | + linux_suites = Kitchen::Config.new(loader: linux_loader).instances.map { |instance| instance.name } |
| 43 | +
|
| 44 | + puts "suites=#{linux_suites.to_json}" |
| 45 | + EORUBY |
| 46 | + outputs: |
| 47 | + windows-suites: ${{ steps.windows.outputs.suites }} |
| 48 | + linux-suites: ${{ steps.linux.outputs.suites }} |
| 49 | + |
| 50 | + integration-windows: |
| 51 | + name: Windows ${{matrix.suite}} |
| 52 | + runs-on: windows-latest |
| 53 | + needs: |
| 54 | + - build-matrix |
35 | 55 | strategy:
|
36 | 56 | fail-fast: false
|
37 |
| - matrix: |
38 |
| - suite: |
39 |
| - - default |
40 |
| - - no-build-context |
41 |
| - - arm64 |
42 |
| - - amd64 |
43 |
| - - inspec |
44 |
| - os: |
45 |
| - - amazonlinux-2023 |
46 |
| - - ubuntu-2204 |
47 |
| - - ubuntu-2404 |
48 |
| - - fedora-latest |
49 |
| - - almalinux-9 |
50 |
| - - rockylinux-9 |
51 |
| - - debian-12 |
52 |
| - - opensuse-15 |
53 |
| - - dockerfile |
54 |
| - ruby: ["3.3"] |
| 57 | + matrix: |
| 58 | + suite: ${{ fromJson(needs.build-matrix.outputs.windows-suites) }} |
55 | 59 | steps:
|
56 | 60 | - uses: actions/checkout@v4
|
57 | 61 | - uses: ruby/setup-ruby@v1
|
58 | 62 | with:
|
59 |
| - ruby-version: ${{ matrix.ruby }} |
| 63 | + ruby-version: "3.3" |
60 | 64 | bundler-cache: true
|
61 |
| - - name: Set up QEMU |
62 |
| - uses: docker/setup-qemu-action@v3 |
63 | 65 | - name: Set up Docker Buildx
|
64 | 66 | uses: docker/setup-buildx-action@v3
|
65 |
| - - run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }} -l debug |
| 67 | + - run: bundle exec kitchen test ${{ matrix.suite }} -l debug |
66 | 68 |
|
67 |
| - integration-capabilities: |
68 |
| - name: Linux ${{matrix.suite}} ${{matrix.os}} |
| 69 | + integration-linux: |
| 70 | + name: Linux ${{matrix.suite}} |
69 | 71 | runs-on: ubuntu-latest
|
70 |
| - needs: lint-unit |
| 72 | + needs: |
| 73 | + - build-matrix |
71 | 74 | strategy:
|
72 | 75 | fail-fast: false
|
73 | 76 | matrix:
|
74 |
| - suite: |
75 |
| - - capabilities |
76 |
| - os: [debian-12, ubuntu-2204, ubuntu-2404] |
77 |
| - ruby: ["3.3"] |
| 77 | + suite: ${{ fromJson(needs.build-matrix.outputs.linux-suites) }} |
78 | 78 | steps:
|
79 | 79 | - uses: actions/checkout@v4
|
80 | 80 | - uses: ruby/setup-ruby@v1
|
81 | 81 | with:
|
82 |
| - ruby-version: ${{ matrix.ruby }} |
| 82 | + ruby-version: "3.3" |
83 | 83 | bundler-cache: true
|
| 84 | + - name: Set up QEMU |
| 85 | + uses: docker/setup-qemu-action@v3 |
84 | 86 | - name: Set up Docker Buildx
|
85 | 87 | uses: docker/setup-buildx-action@v3
|
86 |
| - - run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }} -l debug |
| 88 | + - run: bundle exec kitchen test ${{ matrix.suite }} -l debug |
0 commit comments