97 lines
3.4 KiB
YAML
97 lines
3.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
tags:
|
|
- "**"
|
|
branches:
|
|
- main
|
|
schedule:
|
|
- cron: "0 0 * * *"
|
|
|
|
jobs:
|
|
generate-config:
|
|
runs-on: ubuntu-latest
|
|
permissions: write-all
|
|
outputs:
|
|
BIRTH_GITHUB_TARGETS: ${{ steps.generate-config.outputs.BIRTH_GITHUB_TARGETS }}
|
|
BIRTH_CMAKE_BUILD_TYPES: ${{ steps.generate-config.outputs.BIRTH_CMAKE_BUILD_TYPES }}
|
|
BIRTH_MACOS_IMAGE: ${{ steps.generate-config.outputs.BIRTH_LINUX_IMAGE }}
|
|
BIRTH_LINUX_IMAGE: ${{ steps.generate-config.outputs.BIRTH_LINUX_IMAGE }}
|
|
BIRTH_WINDOWS_IMAGE: ${{ steps.generate-config.outputs.BIRTH_WINDOWS_IMAGE }}
|
|
RELEASE_TAG_NAME: ${{ steps.set_tag.outputs.RELEASE_TAG_NAME }} # Define job output here
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
- name: Generate config
|
|
id: generate-config
|
|
uses: birth-software/github-config@v2
|
|
- name: Create tag
|
|
if: github.ref == 'refs/heads/main'
|
|
shell: bash
|
|
run: |
|
|
git config --global user.name "github-actions"
|
|
git config --global user.email "github-actions@github.com"
|
|
DATE=$(date +"%Y-%m-%d %H:%M:%S")
|
|
COMMIT_HASH=$(git rev-parse --short HEAD)
|
|
TAG="latest"
|
|
git tag -a "$TAG" -m "Release on $DATE for commit $COMMIT_HASH" -f
|
|
git push origin "$TAG" -f
|
|
echo "RELEASE_TAG_NAME=$TAG" >> $GITHUB_OUTPUT
|
|
build_and_test:
|
|
needs: generate-config
|
|
permissions: write-all
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: ${{ fromJSON(needs.generate-config.outputs.BIRTH_GITHUB_TARGETS) }}
|
|
CMAKE_BUILD_TYPE: ${{ fromJSON(needs.generate-config.outputs.BIRTH_CMAKE_BUILD_TYPES) }}
|
|
runs-on: ${{ matrix.os }}
|
|
env:
|
|
BIRTH_LINUX_IMAGE: ${{ needs.generate-config.outputs.BIRTH_LINUX_IMAGE }}
|
|
BIRTH_MACOS_IMAGE: ${{ needs.generate-config.outputs.BIRTH_MACOS_IMAGE }}
|
|
BIRTH_WINDOWS_IMAGE: ${{ needs.generate-config.outputs.BIRTH_WINDOWS_IMAGE }}
|
|
RELEASE_TAG_NAME: ${{ needs.generate-config.outputs.RELEASE_TAG_NAME }}
|
|
steps:
|
|
- name: Maximize build space
|
|
if: matrix.os == env.BIRTH_LINUX_IMAGE
|
|
uses: AdityaGarg8/remove-unwanted-software@v4.1
|
|
with:
|
|
remove-android: 'true'
|
|
remove-dotnet: 'true'
|
|
remove-haskell: 'true'
|
|
remove-codeql: 'true'
|
|
remove-docker-images: 'true'
|
|
remove-large-packages: 'true'
|
|
remove-cached-tools: 'true'
|
|
remove-swapfile: 'true'
|
|
- uses: actions/checkout@v4
|
|
- uses: birth-software/github-setup@v2
|
|
- name: Fetch LLVM
|
|
id: FETCH
|
|
run: ./fetch-llvm.sh
|
|
shell: bash
|
|
env:
|
|
CMAKE_BUILD_TYPE: ${{matrix.CMAKE_BUILD_TYPE}}
|
|
- name: Build and test
|
|
run: ./project.sh test all
|
|
shell: bash
|
|
env:
|
|
CMAKE_BUILD_TYPE: ${{matrix.CMAKE_BUILD_TYPE}}
|
|
CMAKE_PREFIX_PATH: ${{steps.FETCH.outputs.CMAKE_PREFIX_PATH}}
|
|
BUSTER_GITHUB_RUN: "true"
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v2
|
|
if: github.ref == 'refs/heads/main'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
prerelease: true
|
|
name: "Development build"
|
|
tag_name: ${{env.RELEASE_TAG_NAME}}
|
|
fail_on_unmatched_files: true
|
|
files: |
|
|
${{env.BLOAT_BUSTER_RELEASE_PATH_BASE}}.7z
|
|
${{env.BLOAT_BUSTER_RELEASE_PATH_BASE}}.7z.b2sum
|