Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build Status

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 2

- name: Initialize variables
id: vars
uses: ./initialize-variables

- name: Verify outputs
run: |
echo "COMMIT_MESSAGE=$COMMIT_MESSAGE"
echo "FULL_BUILD=$FULL_BUILD"
test -n "$COMMIT_MESSAGE"
case "$FULL_BUILD" in
true|false) ;;
*) echo "FULL_BUILD is not a boolean"; exit 1 ;;
esac
shell: bash
env:
COMMIT_MESSAGE: ${{ steps.vars.outputs.COMMIT_MESSAGE }}
FULL_BUILD: ${{ steps.vars.outputs.FULL_BUILD }}
6 changes: 3 additions & 3 deletions initialize-variables/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:
outputs:
COMMIT_MESSAGE:
description: "Latest commit message"
value: ${{ steps.setup.outputs.COMMIT_MSG }}
value: ${{ steps.setuppush.outputs.COMMIT_MSG || steps.setuppr.outputs.COMMIT_MSG || steps.setupmanual.outputs.COMMIT_MSG }}
FULL_BUILD:
description: "Whether to do a full build"
value: ${{ steps.setuppush.outputs.FULL_BUILD || steps.setuppr.outputs.FULL_BUILD || steps.setupmanual.outputs.FULL_BUILD }}
Expand All @@ -32,7 +32,7 @@ runs:

- name: Get Commit Message
shell: bash
run: echo "COMMIT_MSG=$(git log -1 --pretty=%B HEAD^2 | tr '\n' ' ')" >> $GITHUB_ENV
run: echo "COMMIT_MSG=$(git log -1 --pretty=%B HEAD | tr '\n' ' ')" >> $GITHUB_ENV
if: ${{ github.event_name == 'workflow_dispatch' }}

- name: Display and Setup Build Args (Push)
Expand All @@ -45,7 +45,7 @@ runs:
echo "FULL_BUILD=$FULL_BUILD" >> $GITHUB_OUTPUT
env:
FULL_BUILD: ${{ startsWith(github.ref_name, 'v') || contains(github.event.head_commit.message, '[ci-full]') || contains(env.COMMIT_MSG, '[ci-full]') }}
if: ${{ github.event_name == 'push' }}
if: ${{ github.event_name == 'push' }}

- name: Display and Setup Build Args (PR)
id: setuppr
Expand Down