Add test to gh actions #79
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: Makefile CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
CIQ_SDK_VERSION: 6.2.2 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Generate a developer key | |
run: | | |
openssl genrsa -out developer_key.pem 4096 | |
openssl pkcs8 -topk8 -inform PEM -outform DER -in developer_key.pem -out developer_key.der -nocrypt | |
- uses: actions/cache@v4 | |
id: cache-sdk | |
with: | |
path: | | |
/usr/local/bin/connect-iq-sdk-manager | |
~/.Garmin/ConnectIQ | |
key: ${{ runner.os }}-${{ env.CIQ_SDK_VERSION }}-${{ hashFiles('manifest.xml') }} | |
- name: Download and configure ConnectIQ SDK | |
env: | |
GARMIN_USERNAME: ${{ secrets.GARMIN_USERNAME }} | |
GARMIN_PASSWORD: ${{ secrets.GARMIN_PASSWORD }} | |
if: steps.cache-sdk.outputs.cache-hit != 'true' | |
run: | | |
curl -s https://raw.githubusercontent.com/lindell/connect-iq-sdk-manager-cli/master/install.sh | sh -s -- -d v0.7.1 | |
connect-iq-sdk-manager agreement view >> agreement.txt | |
HASH=`grep -Po 'Current Hash: \K.*' agreement.txt` | |
connect-iq-sdk-manager agreement accept --agreement-hash=$HASH | |
connect-iq-sdk-manager login | |
connect-iq-sdk-manager sdk set $CIQ_SDK_VERSION | |
connect-iq-sdk-manager device download --manifest=manifest.xml | |
- name: Create properties.mk | |
run: | | |
touch properties.mk | |
echo "SDK_HOME = `connect-iq-sdk-manager sdk current-path`" >> properties.mk | |
echo "DEVELOPER_KEY = `pwd`/developer_key.der" >> properties.mk | |
echo "cat properties.mk" | |
cat properties.mk | |
- name: Test on one device | |
run: | | |
sudo apt-get install libwebkit2gtk-4.0-37 | |
gdb --args "$MB_HOME"/simulator | |
ls -l "$MB_HOME"/simulator | |
make build-test test DEVICE=venu2 | |
- name: Build | |
run: make build-all | |
- name: Package | |
run: make package |