CI build #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |