-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtest-validity-of-lando-files.yml
More file actions
63 lines (55 loc) · 1.87 KB
/
Copy pathtest-validity-of-lando-files.yml
File metadata and controls
63 lines (55 loc) · 1.87 KB
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
# .github/workflows/test-validity-of-lando-files.yml
# Author: Luke Myers, Daniel M. Zimmerman
# Created: 2024-09-17
# Modified: 2024-09-28
name: Test Validity of Lando Files
on:
push:
branches:
- 'main'
workflow_dispatch:
jobs:
build-matrix:
runs-on: ubuntu-latest
outputs:
lando-files: ${{ steps.generate-matrix.outputs.lando-files }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Generate Matrix
id: generate-matrix
shell: bash
run: |
# Find all .lando files and convert to JSON array
files=$(find . -type f -name '*.lando' -print0 | xargs -0 -n1 printf "%s\n" | jq -R . | jq -s .)
# Set the output using multiline syntax
echo "lando-files<<EOF" >> $GITHUB_OUTPUT
echo "$files" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
test:
name: Check Lando Syntax
needs: build-matrix
runs-on: ubuntu-latest
if: fromJson(needs.build-matrix.outputs.lando-files)[0] != null
strategy:
fail-fast: false
matrix:
lando-file: ${{ fromJson(needs.build-matrix.outputs.lando-files) }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_READ_ONLY_TOKEN_USERNAME }}
password: ${{ secrets.DOCKER_READ_ONLY_TOKEN }}
- name: Pull Docker Image
run: docker pull freeandfair/de-ple-e2eviv:latest
- name: Run `lando validate` on ${{ matrix.lando-file }}
run: |
echo "Processing ${{ matrix.lando-file }}"
docker run --rm \
-v "${{ github.workspace }}":/workspace \
-w /workspace \
freeandfair/de-ple-e2eviv:latest \
lando validate "/workspace/${{ matrix.lando-file }}"