-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (75 loc) · 2.15 KB
/
cicd.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
# Copyright 2023 Nokia
# Licensed under the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
---
name: CICD
"on":
workflow_dispatch:
inputs:
srlinux-version:
description: "SR Linux version"
required: true
default: "23.3.2"
start-tmate:
description: "start tmate before running tests"
type: boolean
required: false
default: false
pull_request:
push:
tags:
- "v*"
jobs:
prepare-matrix:
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.matrix.outputs.output }}
steps:
- uses: actions/checkout@v3
- uses: fabasoad/data-format-converter-action@main
id: matrix
with:
input: ".github/matrix.yml"
from: "yaml"
to: "json"
test:
runs-on: ${{ matrix.runs-on }}
needs: [prepare-matrix]
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.prepare-matrix.outputs.matrix) }}
steps:
# setting env vars for the test based in user input
- name: Set Env vars
run: |
echo "SRLINUX_VERSION=${{ inputs.srlinux-version }}" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install ansible core
run: pip install ansible-core==${{ matrix.ansible-core-version }}
# Uncomment this section to use private images
# - name: ghcr.io login
# uses: docker/login-action@v2
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
- name: Test
run: ./run.sh ci-test
continue-on-error: true
- name: start tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ inputs.start-tmate }}
ansible-sanity-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install ansible core
run: pip install ansible-core==2.13.8
- name: Ansible sanity test
run: ./run.sh sanity-test