-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (52 loc) · 1.51 KB
/
validate.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
# SPDX-FileCopyrightText: 2024 Linutronix GmbH
# SPDX-License-Identifier: 0BSD
name: Validation
on:
push:
schedule:
- cron: "37 2 * * *"
jobs:
generate-matrix:
name: Generate Job Matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- run: echo "matrix=$(./scripts/collect_testcases.py)" >> "$GITHUB_OUTPUT"
id: set-matrix
build:
name: Build yanglint
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/CESNET/libyang.git
- run: mkdir build
working-directory: libyang
- run: cmake -D BUILD_SHARED_LIBS=OFF -S . -B build
working-directory: libyang
- run: cmake --build build
working-directory: libyang
- uses: actions/upload-artifact@master
with:
name: yanglint
path: |
libyang/build/yanglint
validate:
name: Validate
runs-on: ubuntu-latest
needs: [generate-matrix, build]
strategy:
fail-fast: false
max-parallel: 6
matrix:
file: ${{fromJSON(needs.generate-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
- run: git submodule update --init --remote # update to newest upstream YANG models
- uses: actions/download-artifact@master
with:
name: yanglint
path: bin
- run: chmod a+x bin/yanglint
- run: echo "$( pwd )/bin" >> $GITHUB_PATH
- run: ./scripts/validate.py ${{ matrix.file }}