-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (69 loc) · 1.87 KB
/
build.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
name: CI build
on:
workflow_dispatch:
# push:
# branches: [ "main" ]
# pull_request:
# branches: [ "main" ]
jobs:
build:
strategy:
matrix:
configuration: [Release]
runs-on: ubuntu-latest
env:
Configuration: Release
steps:
- name: Print Info
id: print-info
run: |
pwd
echo $GITHUB_WORKSPACE
ls -la
- name: Cache cjson
id: cache-cjson
uses: actions/cache@v4
env:
cache-name: cache-cjson
with:
path: /tmp/cjson
key: ${{ runner.os }}-build-${{ env.cache-name }}
- if: ${{ steps.cache-cjson.outputs.cache-hit != 'true' }}
name: Download cJSON
uses: actions/checkout@v4
with:
github-server-url: 'https://github.com'
repository: 'DaveGamble/cJSON'
sparse-checkout: |
cJSON.c
cJSON.h
continue-on-error: false
- name: Check dependencies
run: |
mkdir /tmp/cjson
cp cJSON.* /tmp/cjson
tree /tmp/cjson
- name: Checkout
uses: actions/checkout@v4
- name: Build C
run: |
cd c/wsgup
cp /tmp/cjson/cJSON.c src/
cp /tmp/cjson/cJSON.h include/
cmake -B build .
cmake --build build
cd $GITHUB_WORKSPACE/c/wsgup
env:
Configuration: ${{ matrix.configuration }}
- name: Prepare upload artifact
run: |
mkdir -p /tmp/upload
echo "test" > /tmp/upload/test.txt
cp $GITHUB_WORKSPACE/c/wsgup/build/wsgup /tmp/upload
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: wreck
path: /tmp/upload
if-no-files-found: error
retention-days: 1