Skip to content

CMake

CMake #484

Workflow file for this run

name: CMake
on: workflow_dispatch
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set-env
run: VER=`date +"%y.%m%d-%H%M"`;
BRANCH=`git branch --show-current`;
echo "FILE_VERSION=${BRANCH}-${VER}" >> $GITHUB_ENV
- name: Build
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
# working-directory: ~/XCVario
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: touch $PWD/main/Version.h;
echo "#define CIPHER_KEY \"${{ secrets.AHRS_CIPHER_KEY }}\"" >$PWD/main/cipherkey.h;
docker run --rm -v $PWD:/project -w /project espressif/idf:v4.3.6 idf.py build;
mkdir -p artifacts;
cp $PWD/build/sensor.bin $PWD/artifacts/sensor-${{ env.FILE_VERSION }}.bin;
cp $PWD/build/sensor.elf $PWD/artifacts/sensor-${{ env.FILE_VERSION }}.elf;
gzip $PWD/artifacts/sensor-${{ env.FILE_VERSION }}.elf;
ls artifacts/*;
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: XCVario-${{ env.FILE_VERSION }}
path: artifacts/sensor-${{ env.FILE_VERSION }}.bin
- name: Upload ELF
uses: actions/upload-artifact@v3
with:
name: XCVario-${{ env.FILE_VERSION }}
path: artifacts/sensor-${{ env.FILE_VERSION }}.elf.gz