-
Notifications
You must be signed in to change notification settings - Fork 10
58 lines (54 loc) · 1.15 KB
/
c-test.yaml
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
name: c-test
on:
push:
branches:
- main
- master
tags:
- '*'
pull_request:
branches:
- main
paths:
- "c/**"
- ".github/workflows/c-test.yaml"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build-and-test:
defaults:
run:
working-directory: "c"
strategy:
matrix:
os: [macos-12, macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.79
override: true
components: clippy, rustfmt
- name: Build
run: |
make
make examples
- name: Run Examples
shell: bash
run: |
for file in ./examples/*
do
if [[ -f "$file" && -x "$file" ]]; then
echo "Executing: $file"
if ! "$file"; then
echo "Error occurred while executing $file. Exiting script."
exit 1
fi
fi
done