-
Notifications
You must be signed in to change notification settings - Fork 11
144 lines (127 loc) · 4.07 KB
/
ci.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# YAML schema for GitHub Actions:
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
#
# Helpful YAML parser to clarify YAML syntax:
# https://yaml-online-parser.appspot.com/
#
# This workflow uses actions that are not certified by GitHub. They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support documentation.
#
# This file contains the workflows that are run prior to merging a pull request.
name: CI
on:
push:
branches:
- 'main'
- 'develop'
pull_request:
branches:
- 'main'
- 'develop'
# Allow manually triggering of the workflow.
workflow_dispatch:
inputs:
run_driver_tests:
description: 'Force Driver Testing? (yes/no)'
default: 'no'
env:
FWK_IO_TESTER_IMAGE: 'ghcr.io/xmos/fwk_io_tester:develop'
jobs:
# JOB to run change detection
changes:
runs-on: ubuntu-latest
name: Change detection
# Set job outputs to values from filter step
outputs:
i2c: ${{ github.event.inputs.run_driver_tests == 'yes' || steps.filter.outputs.i2c }}
i2s: ${{ github.event.inputs.run_driver_tests == 'yes' || steps.filter.outputs.i2s }}
spi: ${{ github.event.inputs.run_driver_tests == 'yes' || steps.filter.outputs.spi }}
uart: ${{ github.event.inputs.run_driver_tests == 'yes' || steps.filter.outputs.uart }}
steps:
- name: Checkout
if: ${{ github.event.inputs.run_driver_tests != 'yes' }}
uses: actions/checkout@v2
with:
submodules: recursive
- name: Paths filter
if: ${{ github.event.inputs.run_driver_tests != 'yes' }}
uses: dorny/paths-filter@v2
id: filter
with:
filters: |
i2c:
- 'modules/i2c/**'
- 'test/lib_i2c/**'
i2s:
- 'modules/i2s/**'
- 'test/lib_i2s/**'
spi:
- 'modules/spi/**'
- 'test/lib_spi/**'
uart:
- 'modules/uart/**'
- 'test/lib_uart/**'
i2ctests:
needs: changes
name: I2C tests
if: ${{ needs.changes.outputs.i2c == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Pull Docker builder image
run: |
docker pull ${FWK_IO_TESTER_IMAGE}
- name: Run tests
run: |
docker run --rm -w /fwk_io/test -v ${{github.workspace}}:/fwk_io ${FWK_IO_TESTER_IMAGE} bash -l run_tests.sh lib_i2c
i2stests:
name: I2S tests
needs: changes
if: ${{ needs.changes.outputs.i2s == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Pull Docker builder
run: |
docker pull ${FWK_IO_TESTER_IMAGE}
- name: Run tests
run: |
docker run --rm -w /fwk_io/test -v ${{github.workspace}}:/fwk_io ${FWK_IO_TESTER_IMAGE} bash -l run_tests.sh lib_i2s
spitests:
name: SPI tests
needs: changes
if: ${{ needs.changes.outputs.spi == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Pull Docker builder image
run: |
docker pull ${FWK_IO_TESTER_IMAGE}
- name: Run tests
run: |
docker run --rm -w /fwk_io/test -v ${{github.workspace}}:/fwk_io ${FWK_IO_TESTER_IMAGE} bash -l run_tests.sh lib_spi
uarttests:
name: UART tests
needs: changes
if: ${{ needs.changes.outputs.uart == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Pull Docker builder
run: |
docker pull ${FWK_IO_TESTER_IMAGE}
- name: Run tests
run: |
docker run --rm -w /fwk_io/test -v ${{github.workspace}}:/fwk_io ${FWK_IO_TESTER_IMAGE} bash -l run_tests.sh lib_uart