Merge pull request #316 from AntelopeIO/merge-official-4.1-release #1
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: "Build & Test" | |
on: | |
push: | |
branches: | |
- main | |
- "release/*" | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
override-antelope-spring-dev: | |
description: Override antelope-spring-dev target | |
type: string | |
override-antelope-spring-dev-prerelease: | |
type: choice | |
description: Override antelope-spring-dev prelease | |
options: | |
- default | |
- true | |
- false | |
permissions: | |
packages: write | |
contents: read | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
platform-cache: | |
name: Platform Cache | |
uses: AntelopeIO/platform-cache-workflow/.github/workflows/platformcache.yaml@v1 | |
permissions: | |
packages: write | |
contents: read | |
with: | |
runs-on: '["self-hosted", "enf-x86-beefy"]' | |
platform-files: .cicd/platforms | |
versions: | |
name: Determine Versions | |
runs-on: ubuntu-latest | |
outputs: | |
antelope-spring-dev-target: ${{steps.versions.outputs.antelope-spring-dev-target}} | |
antelope-spring-dev-prerelease: ${{steps.versions.outputs.antelope-spring-dev-prerelease}} | |
steps: | |
- name: Setup versions from input or defaults | |
id: versions | |
env: | |
GH_TOKEN: ${{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 antelope-spring-dev-target=$(echo "$DEFAULTS_JSON" | jq -r '."antelope-spring-dev".target') >> $GITHUB_OUTPUT | |
echo antelope-spring-dev-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '."antelope-spring-dev".prerelease') >> $GITHUB_OUTPUT | |
if [[ "${{inputs.override-antelope-spring-dev}}" != "" ]]; then | |
echo antelope-spring-dev-target=${{inputs.override-antelope-spring-dev}} >> $GITHUB_OUTPUT | |
fi | |
if [[ "${{inputs.override-antelope-spring-dev-prerelease}}" == +(true|false) ]]; then | |
echo antelope-spring-dev-prerelease=${{inputs.override-antelope-spring-dev-prerelease}} >> $GITHUB_OUTPUT | |
fi | |
Build: | |
name: Build & Test | |
needs: [platform-cache, versions] | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ubuntu20, ubuntu22, ubuntu22-llvm, ubuntu24] | |
runs-on: ["self-hosted", "enf-x86-beefy"] | |
container: ${{fromJSON(needs.platform-cache.outputs.platforms)[matrix.platform].image}} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Download antelope-spring-dev.deb (Ubuntu 22 only) | |
if: matrix.platform == 'ubuntu22' | |
uses: AntelopeIO/asset-artifact-download-action@v3 | |
with: | |
owner: AntelopeIO | |
repo: spring | |
file: 'antelope-spring-dev.*ubuntu22\.04_amd64.deb' | |
target: '${{needs.versions.outputs.antelope-spring-dev-target}}' | |
prereleases: ${{fromJSON(needs.versions.outputs.antelope-spring-dev-prerelease)}} | |
artifact-name: antelope-spring-dev-ubuntu22-amd64 | |
container-package: antelope-spring-experimental-binaries | |
- name: Install antelope-spring-dev.deb (Ubuntu 22 only) | |
if: matrix.platform == 'ubuntu22' | |
run: | | |
apt-get update && apt-get upgrade -y | |
apt install -y ./antelope-spring-dev*.deb | |
rm ./antelope-spring-dev*.deb | |
- name: Build & Test | |
run: | | |
mkdir build | |
cd build | |
cmake -DCMAKE_BUILD_TYPE=Release .. | |
make -j $(nproc) | |
cd tests | |
ctest -j $(nproc) --output-on-failure | |
- name: Package (Ubuntu 20 only) | |
if: matrix.platform == 'ubuntu20' | |
run: | | |
cd build/packages | |
bash generate_package.sh deb ubuntu amd64 | |
- name: Upload (Ubuntu 20 only) | |
if: matrix.platform == 'ubuntu20' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cdt_ubuntu_package_amd64 | |
path: build/packages/cdt*amd64.deb |