Skip to content

Fix fragile powerup_tests/weight_tests so that they can run under Savanna #208

Fix fragile powerup_tests/weight_tests so that they can run under Savanna

Fix fragile powerup_tests/weight_tests so that they can run under Savanna #208

Workflow file for this run

name: "Build & Test"
on:
push:
branches:
- main
- "release/*"
pull_request:
workflow_dispatch:
inputs:
override-spring-dev:
description: Override spring-dev target
type: string
override-spring-dev-prerelease:
type: choice
description: Override spring-dev prelease
options:
- default
- true
- false
override-cdt:
description: 'Override cdt target'
type: string
override-cdt-prerelease:
type: choice
description: Override cdt prelease
options:
- default
- true
- false
defaults:
run:
shell: bash
jobs:
build-test:
name: Build & Test
runs-on: ubuntu-22.04
steps:
- name: Setup spring-dev & cdt versions
id: versions
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
DEFAULTS_JSON=$(curl -sSfL $(gh api https://api.github.com/repos/${{github.repository}}/contents/.cicd/defaults.json?ref=${{github.sha}} --jq .download_url))
echo spring-dev-target=$(echo "$DEFAULTS_JSON" | jq -r '."spring-dev".target') >> $GITHUB_OUTPUT
echo spring-dev-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '."spring-dev".prerelease') >> $GITHUB_OUTPUT
echo cdt-target=$(echo "$DEFAULTS_JSON" | jq -r '.cdt.target') >> $GITHUB_OUTPUT
echo cdt-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '.cdt.prerelease') >> $GITHUB_OUTPUT
if [[ "${{inputs.override-spring-dev}}" != "" ]]; then
echo spring-dev-target=${{inputs.override-spring-dev}} >> $GITHUB_OUTPUT
fi
if [[ "${{inputs.override-spring-dev-prerelease}}" == +(true|false) ]]; then
echo spring-dev-prerelease=${{inputs.override-spring-dev-prerelease}} >> $GITHUB_OUTPUT
fi
if [[ "${{inputs.override-cdt}}" != "" ]]; then
echo cdt-target=${{inputs.override-cdt}} >> $GITHUB_OUTPUT
fi
if [[ "${{inputs.override-cdt-prerelease}}" == +(true|false) ]]; then
echo cdt-prerelease=${{inputs.override-cdt-prerelease}} >> $GITHUB_OUTPUT
fi
- name: Download cdt
uses: AntelopeIO/asset-artifact-download-action@v3
with:
owner: AntelopeIO
repo: cdt
file: 'cdt_.*amd64.deb'
target: '${{steps.versions.outputs.cdt-target}}'
prereleases: ${{fromJSON(steps.versions.outputs.cdt-prerelease)}}
artifact-name: cdt_ubuntu_package_amd64
- name: Download spring-dev
uses: AntelopeIO/asset-artifact-download-action@v3
with:
owner: AntelopeIO
repo: spring
file: 'spring-dev.*ubuntu22\.04_amd64.deb'
target: '${{steps.versions.outputs.spring-dev-target}}'
prereleases: ${{fromJSON(steps.versions.outputs.spring-dev-prerelease)}}
artifact-name: spring-dev-ubuntu22-amd64
container-package: experimental-binaries
- name: Install packages
run: |
sudo apt-get update && sudo apt-get upgrade -y
sudo apt install ./*.deb
sudo apt-get install cmake
rm ./*.deb
- uses: actions/checkout@v4
with:
path: src
- name: Build & Test
run: |
cmake -S src -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=On -DSYSTEM_ENABLE_SPRING_VERSION_CHECK=Off -DSYSTEM_ENABLE_CDT_VERSION_CHECK=Off
cmake --build build -- -j $(nproc)
tar zcf build.tar.gz build
ctest --test-dir build/tests --output-on-failure -j $(nproc)
- name: Upload builddir
uses: actions/upload-artifact@v3
with:
name: builddir
path: build.tar.gz