-
Notifications
You must be signed in to change notification settings - Fork 17
137 lines (132 loc) · 4.43 KB
/
test.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
name: Build & Test Action
on:
pull_request:
push:
branches:
- main
- ci
- 'releases/*'
jobs:
# Test and check build errors
test-build:
name: Run tests and build Action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm install
- run: npm run all
- name: Run action to check no exceptions are thrown
uses: ./
with:
release: '10.3-2021.07'
path-env-var: ARM_NONE_EABI_GCC_PATH
# Run this Action with all GCC versions, in all OS, and build a simple STM32 project
test-all-releases:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
release:
- 'latest'
- '12.2.Rel1'
- '11.3.Rel1'
- '11.2-2022.02'
- '10.3-2021.10'
- '10.3-2021.07'
- '10-2020-q4'
- '9-2020-q2'
- '9-2019-q4'
- '8-2019-q3'
- '8-2018-q4'
- '7-2018-q2'
- '7-2017-q4'
- '6-2017-q2'
- '6-2017-q1'
- '6-2016-q4'
- '5-2016-q3'
- '5-2016-q2'
- '5-2016-q1'
- '5-2015-q4'
- '4.9-2015-q3'
- '4.9-2015-q2'
- '4.9-2015-q1'
- '4.9-2014-q4'
- '4.8-2014-q3'
- '4.8-2014-q2'
- '4.8-2014-q1'
- '4.7-2014-q2'
- '4.8-2013-q4'
- '4.7-2013-q3'
- '4.7-2013-q2'
- '4.7-2013-q1'
name: Test ${{ matrix.release }} @ ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Ensure the compiler is not present (Unix)
if: runner.os != 'Windows'
run: '! arm-none-eabi-gcc --version'
- name: Set up GCC Arm Compiler
uses: ./
with:
release: ${{ matrix.release }}
- name: Print out programs invoked by the compiler
run: arm-none-eabi-gcc -v
- name: Print out version
run: arm-none-eabi-gcc --version
- name: Check the version matches
if: |
(!contains(matrix.release, '2013') && !contains(matrix.release, '2014')
&& !contains(matrix.release, '2015') && !contains(matrix.release, '2016')
&& (matrix.release != 'latest'))
run: arm-none-eabi-gcc --version | grep -q ${{ matrix.release }}
- name: Clone STM32 project
uses: actions/checkout@v3
with:
repository: 'trebisky/stm32f103'
ref: 7cfe5feaf02c653352331374d2ad178eb04efde7
path: 'stm32f103/'
- name: Build simple blinky project
working-directory: ./stm32f103/blink1/
run: make all
# Check Action env var path
test-exports:
name: Test path output and env var
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Ensure the compiler is not present
run: '! arm-none-eabi-gcc --version'
- name: Set up GCC Arm Compiler with environmental variable
id: action-under-test-id
uses: ./
with:
release: '7-2017-q4'
path-env-var: ARM_NONE_EABI_GCC_PATH
- name: Print out version
run: arm-none-eabi-gcc --version
- name: Check the version matches
run: arm-none-eabi-gcc --version | grep -q 7-2017-q4
- name: Print path via env var and output
run: echo "output -> ${{ steps.action-under-test-id.outputs.path }} \n env var -> $ARM_NONE_EABI_GCC_PATH"
- name: Check env var path is correct
run: echo "Path $ARM_NONE_EABI_GCC_PATH" | grep -q /home/runner/gcc-arm-none-eabi-7.2017.4-linux/gcc-arm-none-eabi-7-2017-q4-major/bin
- name: Check output path is correct
run: echo "Path ${{ steps.action-under-test-id.outputs.path }}" | grep -q /home/runner/gcc-arm-none-eabi-7.2017.4-linux/gcc-arm-none-eabi-7-2017-q4-major/bin
# Run Action without inputs
test-default:
name: Test default options
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Ensure the compiler is not present
run: '! arm-none-eabi-gcc --version'
- name: Set up GCC Arm Compiler with default options
uses: ./
id: action-under-test-id
- name: Print out version
run: arm-none-eabi-gcc --version
- name: Check the version matches
run: arm-none-eabi-gcc --version | grep -q 12.2.Rel1
- name: Check output path is correct
run: echo "${{ steps.action-under-test-id.outputs.path }}" | grep -q /home/runner/gcc-arm-none-eabi-12.2.1-linux/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin