-
Notifications
You must be signed in to change notification settings - Fork 5
62 lines (54 loc) · 2.23 KB
/
test-software.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
# ------------------------------------------------------------------------------
# USB EPROM/Flash Programmer
#
# Copyright (2024) Robson Martins
#
# This work is licensed under a Creative Commons Attribution-NonCommercial-
# ShareAlike 4.0 International License.
# ------------------------------------------------------------------------------
name: Test Software
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
BUILD_TYPE: Debug
SOFTWARE_PROJECT_DIR: ${{github.workspace}}/software/usbflashprog
jobs:
build:
name: Test Software
runs-on: ubuntu-latest
steps:
# ------------------------------------------------------------------------
# Checkout the sources
# ------------------------------------------------------------------------
- name: Checkout the Sources
uses: actions/checkout@v4
# ------------------------------------------------------------------------
# Install Prerequisites
# ------------------------------------------------------------------------
- name: Install Prerequisites
run: |
sudo apt-get update
sudo apt-get install cmake build-essential libglu1-mesa-dev libpulse-dev libglib2.0-dev
sudo apt-get --no-install-recommends install libqt*5-dev qt*5-dev libqt5waylandcompositor5-dev
# ------------------------------------------------------------------------
# Configure CMake
# ------------------------------------------------------------------------
- name: Configure CMake
working-directory: ${{env.SOFTWARE_PROJECT_DIR}}
run: cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DTEST_BUILD=ON
# ------------------------------------------------------------------------
# Build
# ------------------------------------------------------------------------
- name: Build
working-directory: ${{env.SOFTWARE_PROJECT_DIR}}
run: cmake --build build --config ${{env.BUILD_TYPE}}
# ------------------------------------------------------------------------
# Test
# ------------------------------------------------------------------------
- name: Test
working-directory: ${{env.SOFTWARE_PROJECT_DIR}}/build
run: ctest -C ${{env.BUILD_TYPE}}