Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ItzSelenux committed Sep 7, 2024
1 parent 2880629 commit 691c2c9
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: C/C++ CI

permissions:
contents: write

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
libgtk-3-dev \
pkg-config \
clang
- name: Build with GCC
run: |
make CC=gcc
mv sglauncher sglauncher-$(ldd --version | awk '/ldd/{print "-gnu-" $NF}')
- name: Build with Clang
run: |
make CC=clang
continue-on-error: true

- name: Build with -Werror
run: |
cc `pkg-config --cflags gtk+-3.0` -Dmver=\"NULL\" -Werror -o sglauncher sglauncher.o `pkg-config --libs gtk+-3.0` -lm --verbose
continue-on-error: true

- name: Set up variables
id: date
run: |
echo "DATE=$(git log -n 1 --format='%ad' --date=format-local:'%Y%m%d%H%M%S')" >> $GITHUB_ENV
echo "GH_RELEASE_FILE=sglauncher-$(ldd --version | awk '/ldd/{print "-gnu-" $NF}')" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v2
with:
body: Release ci-${{ env.DATE }}
name: Continuous GitHub CI
tag_name: ${{ env.DATE }}
files: |
${{ env.GH_RELEASE_FILE }}

0 comments on commit 691c2c9

Please sign in to comment.