mirror of
https://github.com/javalsai/lidm.git
synced 2025-07-03 14:25:03 +02:00
feat(ci): make build check a check status
This commit is contained in:
parent
c4c358ceef
commit
154308dfd7
10
.github/actions/build/action.yml
vendored
10
.github/actions/build/action.yml
vendored
@ -23,6 +23,7 @@ runs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
# cache-apt-pkgs-action try to cache :i386 packages challenge impossible
|
# cache-apt-pkgs-action try to cache :i386 packages challenge impossible
|
||||||
- if: ${{ inputs.arch_name == 'x86' }}
|
- if: ${{ inputs.arch_name == 'x86' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -33,18 +34,21 @@ runs:
|
|||||||
|
|
||||||
- uses: awalsh128/cache-apt-pkgs-action@latest
|
- uses: awalsh128/cache-apt-pkgs-action@latest
|
||||||
with:
|
with:
|
||||||
packages: "libpam0g-dev gcc-multilib libx32stdc++6 libaio1"
|
packages: "libpam0g-dev gcc-multilib"
|
||||||
version: 1.0
|
version: 1.0
|
||||||
|
|
||||||
- name: Build Code
|
- name: Build Code
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
make CC=${{ inputs.cc }} CFLAGS="-O3 ${{ inputs.cflags }}"
|
make CC=${{ inputs.cc }} CFLAGS="-O3 ${{ inputs.cflags }}" \
|
||||||
|
2> stderr-${{ inputs.arch_name }}
|
||||||
mv lidm lidm-${{ inputs.arch_name }}
|
mv lidm lidm-${{ inputs.arch_name }}
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: build-${{ inputs.arch_name }}
|
name: build-${{ inputs.arch_name }}
|
||||||
path: lidm-${{ inputs.arch_name }}
|
path: |
|
||||||
|
lidm-${{ inputs.arch_name }}
|
||||||
|
stderr-${{ inputs.arch_name }}
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
53
.github/workflows/build-check.yml
vendored
53
.github/workflows/build-check.yml
vendored
@ -1,15 +1,10 @@
|
|||||||
name: Test Build
|
name: Test Build
|
||||||
|
|
||||||
on:
|
on: push
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- '*'
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check_build:
|
check_build:
|
||||||
|
permissions: write-all
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
@ -23,10 +18,48 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Testing Build Process on ${{ matrix.arch_name }}
|
- uses: myrotvorets/set-commit-status-action@master
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
status: pending
|
||||||
|
context: Build (${{ matrix.arch_name }})
|
||||||
|
|
||||||
|
- name: Attempt Build (${{ matrix.arch_name }})
|
||||||
uses: ./.github/actions/build
|
uses: ./.github/actions/build
|
||||||
with:
|
with:
|
||||||
# TODO: make arch_name optional (dont upload artifact)
|
|
||||||
arch_name: ${{ matrix.arch_name }}
|
arch_name: ${{ matrix.arch_name }}
|
||||||
cc: ${{ matrix.cc }}
|
cc: ${{ matrix.cc }}
|
||||||
cflags: ${{ matrix.cflags }}
|
cflags: "-Wall ${{ matrix.cflags }}"
|
||||||
|
|
||||||
|
- name: Download Build Results
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: build-${{ matrix.arch_name }}
|
||||||
|
path: build-results
|
||||||
|
|
||||||
|
- name: Process Results
|
||||||
|
id: get-stats
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
if ! [ -d "build-results" ]; then
|
||||||
|
# Build failed
|
||||||
|
echo "DESCR=" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
# Build Succeeded
|
||||||
|
cd "build-results"
|
||||||
|
ls -lah
|
||||||
|
cat stderr-* >&2
|
||||||
|
WARNS="$(cat stderr-* | grep '^[^ ]*\.[ch]:' | wc -l)"
|
||||||
|
HSIZE="$(stat --printf="%s" lidm-* | numfmt --to=iec-i)B"
|
||||||
|
|
||||||
|
echo "DESCR='$HSIZE, $WARNS warnings'" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Set final commit status
|
||||||
|
uses: myrotvorets/set-commit-status-action@master
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
status: ${{ job.status }}
|
||||||
|
context: Build (${{ matrix.arch_name }})
|
||||||
|
description: ${{ steps.get-stats.outputs.DESCR }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user