Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Verify and cleanup jobs. #93

Merged
merged 5 commits into from
Jul 12, 2022
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
46 changes: 46 additions & 0 deletions .github/actions/mach_build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: mach_build
description: mach | Build (Debug + Release)
inputs:
bits:
description: Bits (`32`, `64`)
required: true
edition:
description: Edition (`c89`, ``)
required: true
target:
description: Target
required: false
default: ""
args:
description: Any extra arguments
required: false
default: ""
runs:
using: composite
steps:
- run: echo "BITS_FLAG=-m32" > $GITHUB_ENV
shell: bash
if: ${{ inputs.bits == '32' }}
- run: echo "BITS_FLAG=" > $GITHUB_ENV
shell: bash
if: ${{ inputs.bits == '64' }}

- run: echo "EDITION_FLAG=-ec89" > $GITHUB_ENV
shell: bash
if: ${{ inputs.edition == 'c89' }}
- run: echo "EDITION_FLAG=" > $GITHUB_ENV
shell: bash
if: ${{ inputs.edition == '' }}

- run: echo "TARGET_FLAG=--target ${{ inputs.target }}" > $GITHUB_ENV
shell: bash
if: ${{ inputs.target != '' }}
- run: echo "TARGET_FLAG=" > $GITHUB_ENV
shell: bash
if: ${{ inputs.target == '' }}

- name: mach | Build (Debug + Release)
shell: bash
run: |
./mach build -v --tests $BITS_FLAG $EDITION_FLAG $TARGET_FLAG ${{ inputs.args }}
./mach build -v --tests --release $BITS_FLAG $EDITION_FLAG $TARGET_FLAG ${{ inputs.args }}
11 changes: 11 additions & 0 deletions .github/actions/mach_install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: mach_install
description: mach | Install (Debug + Release)
runs:
using: composite
steps:
- shell: bash
run: |
mkdir pkg-debug
./mach install -p $PWD/pkg-debug
mkdir pkg-release
./mach install -p $PWD/pkg-release -c Release
46 changes: 46 additions & 0 deletions .github/actions/mach_test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: mach_test
description: mach | Test (Debug + Release)
inputs:
bits:
description: Bits (`32`, `64`)
required: true
edition:
description: Edition (`c89`, ``)
required: true
target:
description: Target
required: false
default: ""
args:
description: Any extra arguments
required: false
default: ""
runs:
using: composite
steps:
- run: echo "BITS_FLAG=-m32" > $GITHUB_ENV
duesee marked this conversation as resolved.
Show resolved Hide resolved
shell: bash
if: ${{ inputs.bits == '32' }}
- run: echo "BITS_FLAG=" > $GITHUB_ENV
shell: bash
if: ${{ inputs.bits == '64' }}

- run: echo "EDITION_FLAG=-ec89" > $GITHUB_ENV
shell: bash
if: ${{ inputs.edition == 'c89' }}
- run: echo "EDITION_FLAG=" > $GITHUB_ENV
shell: bash
if: ${{ inputs.edition == '' }}

- run: echo "TARGET_FLAG=${{ inputs.target }}" > $GITHUB_ENV
shell: bash
if: ${{ inputs.target != '' }}
- run: echo "TARGET_FLAG=" > $GITHUB_ENV
shell: bash
if: ${{ inputs.target == '' }}

- name: mach | Test (Debug + Release)
shell: bash
run: |
./mach build -v --test $BITS_FLAG $EDITION_FLAG $TARGET_FLAG ${{ inputs.args }}
./mach build -v --test --release $BITS_FLAG $EDITION_FLAG $TARGET_FLAG ${{ inputs.args }}
13 changes: 13 additions & 0 deletions .github/actions/make_short_sha/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: make_short_sha
description: Make SHORT_SHA available in environment
outputs:
short-sha:
description: "Short SHA"
value: ${{ steps.sha.outputs.short-sha }}
runs:
using: composite
steps:
- shell: bash
id: sha
run: |
echo ::set-output name=short-sha::${GITHUB_SHA: -8}
19 changes: 19 additions & 0 deletions .github/actions/upload_artifacts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: upload_artifacts
description: Upload artifacts
inputs:
name:
description: Name
required: true
runs:
using: composite
steps:
- id: sha
uses: ./.github/actions/make_short_sha

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ inputs.name }}_${{ steps.sha.outputs.short-sha }}
path: |
build/Debug
build/Release
Loading