mirror of
https://github.com/javalsai/lidm.git
synced 2025-07-03 22:38:41 +02:00
fix(ci): workflows
This commit is contained in:
parent
b900701b8f
commit
57cb0cd9ad
50
.github/actions/build/action.yml
vendored
Normal file
50
.github/actions/build/action.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
name: Build Project
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
# TODO: make arch_name optional (dont upload artifact)
|
||||||
|
inputs:
|
||||||
|
arch_name:
|
||||||
|
description: "Architecture Name"
|
||||||
|
required: true
|
||||||
|
cc:
|
||||||
|
description: "The compiler to use"
|
||||||
|
required: false
|
||||||
|
default: "gcc"
|
||||||
|
cflags:
|
||||||
|
description: "Compiler flags"
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
# cache-apt-pkgs-action try to cache :i386 packages challenge impossible
|
||||||
|
- if: ${{ inputs.arch_name == 'x86' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo dpkg --add-architecture i386
|
||||||
|
sudo apt-get update -y
|
||||||
|
sudo apt-get install -y libpam0g-dev:i386
|
||||||
|
|
||||||
|
- uses: awalsh128/cache-apt-pkgs-action@latest
|
||||||
|
with:
|
||||||
|
packages: "libpam0g-dev gcc-multilib libx32stdc++6 libaio1"
|
||||||
|
version: 1.0
|
||||||
|
|
||||||
|
- name: Build Code
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
make CC=${{ inputs.cc }} CFLAGS="-O3 ${{ inputs.cflags }}"
|
||||||
|
mv lidm lidm-${{ inputs.arch_name }}
|
||||||
|
|
||||||
|
- name: Upload Artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: build-${{ inputs.arch_name }}
|
||||||
|
path: lidm-${{ inputs.arch_name }}
|
||||||
|
retention-days: 1
|
19
.github/workflows/build-check.yml
vendored
19
.github/workflows/build-check.yml
vendored
@ -10,6 +10,23 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check_build:
|
check_build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- arch_name: x86_64
|
||||||
|
cc: gcc
|
||||||
|
cflags:
|
||||||
|
- arch_name: x86
|
||||||
|
cc: gcc
|
||||||
|
cflags: -m32
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: ./.github/workflows/build.yml
|
- uses: actions/checkout@v4
|
||||||
|
- name: Testing Build Process on ${{ matrix.arch_name }}
|
||||||
|
uses: ./.github/actions/build
|
||||||
|
with:
|
||||||
|
# TODO: make arch_name optional (dont upload artifact)
|
||||||
|
arch_name: ${{ matrix.arch_name }}
|
||||||
|
cc: ${{ matrix.cc }}
|
||||||
|
cflags: ${{ matrix.cflags }}
|
||||||
|
47
.github/workflows/build.yml
vendored
47
.github/workflows/build.yml
vendored
@ -1,47 +0,0 @@
|
|||||||
name: Build Project
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- arch_name: x86_64
|
|
||||||
cc: gcc
|
|
||||||
cflags:
|
|
||||||
- arch_name: x64
|
|
||||||
cc: gcc
|
|
||||||
cflags: -m32
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: awalsh128/cache-apt-pkgs-action@latest
|
|
||||||
with:
|
|
||||||
packages: libpam0g-dev
|
|
||||||
version: 1.0
|
|
||||||
|
|
||||||
- name: Build Code
|
|
||||||
run: |
|
|
||||||
make CC=${{ matrix.cc }} CFLAGS="-O3 ${{ cflags }}"
|
|
||||||
mv lidm lidm-${{ matrix.arch_name }}
|
|
||||||
|
|
||||||
- name: Upload Artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: build-${{ matrix.arch_name }}
|
|
||||||
path: lidm-${{ matrix.arch_name }}
|
|
||||||
|
|
||||||
merge-builds:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: build
|
|
||||||
steps:
|
|
||||||
- name: Merge Artifacts
|
|
||||||
uses: actions/upload-artifact/merge@v4
|
|
||||||
with:
|
|
||||||
name: all-builds
|
|
||||||
pattern: build-*
|
|
||||||
delete-merged: true
|
|
||||||
retention-days: 1
|
|
33
.github/workflows/release.yml
vendored
33
.github/workflows/release.yml
vendored
@ -5,13 +5,40 @@ on:
|
|||||||
types: [created]
|
types: [created]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
build:
|
||||||
permissions: write-all
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- arch_name: x86_64
|
||||||
|
cc: gcc
|
||||||
|
cflags:
|
||||||
|
- arch_name: x86
|
||||||
|
cc: gcc
|
||||||
|
cflags: -m32
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
- name: Build Project
|
- name: Build Project
|
||||||
uses: ./.github/workflows/build.yml
|
uses: ./.github/actions/build
|
||||||
|
with:
|
||||||
|
arch_name: ${{ matrix.arch_name }}
|
||||||
|
cc: ${{ matrix.cc }}
|
||||||
|
cflags: ${{ matrix.cflags }}
|
||||||
|
|
||||||
|
upload:
|
||||||
|
permissions: write-all
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Merge Build Artifacts
|
||||||
|
uses: actions/upload-artifact/merge@v4
|
||||||
|
with:
|
||||||
|
name: all-builds
|
||||||
|
pattern: build-*
|
||||||
|
delete-merged: true
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user