-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (108 loc) · 3.65 KB
/
on-demand.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2021
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
name: Check All
# yamllint disable-line rule:truthy
on:
push:
paths:
- '**.sh'
pull_request_review:
types:
- submitted
jobs:
check-format:
name: Check scripts format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- name: Run the sh-checker
uses: luizm/action-sh-checker@v0.8.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SHFMT_OPTS: -i 4 -s
with:
sh_checker_shellcheck_disable: true
check-shellspec:
name: Run BDD shell specs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- name: Install ShellSpec
run: curl -fsSL https://github.com/shellspec/shellspec/releases/latest/download/shellspec-dist.tar.gz | tar -xz -C ..
- name: Run Shellspec
shell: bash
run: ../shellspec/shellspec
changes:
runs-on: ubuntu-latest
if: >-
(
github.event_name == 'pull_request_review' &&
github.event.review.state == 'approved'
) ||
github.event_name != 'pull_request_review'
outputs:
scripts: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v4.1.1
- uses: dorny/paths-filter@v3.0.1
if: ${{ !env.ACT }}
id: filter
with:
token: ${{ secrets.GITHUB_TOKEN }}
filters: .github/filters.yml
generate-matrix:
name: Generate the Test matrix for vagrant and devcontainers
runs-on: ubuntu-latest
needs:
- changes
outputs:
matrix-alias: ${{ steps.set-matrices.outputs.matrix-alias }}
matrix-image: ${{ steps.set-matrices.outputs.matrix-image }}
enable-vagrant-check: ${{ steps.set-matrices.outputs.enable-vagrant-check }}
enable-devcontainers-check: ${{ steps.set-matrices.outputs.enable-devcontainers-check }}
steps:
- uses: actions/checkout@v4.1.1
- id: set-matrices
env:
DEBUG: true
run: ./ci/generate_matrix.sh '${{ needs.changes.outputs.scripts }}'
check-vagrant:
name: Run vagrant validation for all supported Linux distros
if: needs.generate-matrix.outputs.enable-vagrant-check == 'true'
runs-on: macos-12
needs:
- generate-matrix
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.generate-matrix.outputs.matrix-alias) }}
steps:
- uses: actions/checkout@v4.1.1
- uses: ./.github/actions/check-vagrant
with:
vagrant_name: ${{ matrix.name }}
script: ${{ matrix.script }}
check-devcontainer:
name: Run devcontainer validation for all supported Linux distros
if: needs.generate-matrix.outputs.enable-devcontainers-check == 'true'
runs-on: ubuntu-latest
needs:
- generate-matrix
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.generate-matrix.outputs.matrix-image) }}
steps:
- uses: actions/checkout@v4.1.1
- name: Install latest devcontainer CLI
run: npm install -g @devcontainers/cli
- name: Generating tests for '${{ matrix.script }}'
run: |
devcontainer features test --skip-scenarios --features ${{ matrix.script }} --base-image ${{ matrix.image }} --project-folder .