From dcf30ee389282d232402b59ecea8f61621e78168 Mon Sep 17 00:00:00 2001 From: klemek Date: Sun, 3 May 2026 19:29:32 +0200 Subject: [PATCH] ci: separate build and lint pipelines --- .github/workflows/{ci.yml => build.yml} | 31 +++++++++++++------------ .github/workflows/lint.yml | 25 ++++++++++++++++++++ README.md | 4 ++-- 3 files changed, 43 insertions(+), 17 deletions(-) rename .github/workflows/{ci.yml => build.yml} (62%) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/build.yml similarity index 62% rename from .github/workflows/ci.yml rename to .github/workflows/build.yml index bc1e39d..6900162 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,18 @@ -name: C-lang CI +name: Clang Build CI + +concurrency: + group: build-${{ github.ref }} + cancel-in-progress: true on: + workflow_dispatch: push: - branches: ["master"] - pull_request: - branches: ["master"] + paths: + - '.github/workflows/build.yml' + - 'src/*.c' + - 'src/*.h' + - 'configure.ac' + - 'Makefile.am' env: GCC_ARGS: src/*.c src/*.h -Ofast @@ -12,18 +20,11 @@ env: TEST_ARGS: "" jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: gcc - run: gcc -v -Wall -Wextra -Werror $GCC_ARGS - build-release: - needs: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - name: aclocal run: aclocal - name: autoconf @@ -38,10 +39,10 @@ jobs: run: make distcheck run: - needs: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v5 - name: gcc run: mkdir -p build && gcc $GCC_ARGS -o build/$TARGET - name: run program diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..69df11e --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +name: Clang Lint CI + +concurrency: + group: lint-${{ github.ref }} + cancel-in-progress: true + +on: + workflow_dispatch: + push: + paths: + - '.github/workflows/lint.yml' + - 'src/*.c' + - 'src/*.h' + +env: + GCC_ARGS: src/*.c src/*.h -Ofast + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v5 + - name: gcc + run: gcc -v -Wall -Wextra -Werror $GCC_ARGS diff --git a/README.md b/README.md index b788234..4b1a67a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![C-lang CI](https://github.com/klemek/margen/actions/workflows/ci.yml/badge.svg)](https://github.com/klemek/margen/actions/workflows/ci.yml) +[![](https://git.klemek.fr/klemek/margen/actions/workflows/lint.yml/badge.svg?branch=main&style=flat-square)](https://git.klemek.fr/klemek/margen/actions?workflow=lint.yml) [![](https://git.klemek.fr/klemek/margen/actions/workflows/build.yml/badge.svg?branch=main&style=flat-square)](https://git.klemek.fr/klemek/margen/actions?workflow=build.yml) # margen @@ -90,4 +90,4 @@ git push origin master --tags # attach .tar.gz to the github release make -f Makefile.dev release-arch # attach .pkg.tar.zst to the github release -``` \ No newline at end of file +```