-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github ci workflow, fix build with flags
fix build with flags -Wall -Werror -Wshadow -pedantic
- Loading branch information
Showing
8 changed files
with
107 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Continous CI | ||
|
||
permissions: | ||
contents: write | ||
|
||
on: | ||
push: | ||
branches: [ "stable" ] | ||
pull_request: | ||
branches: [ "stable" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up variables | ||
id: date | ||
run: | | ||
echo "DATE=$(git log -n 1 --format='%ad' --date=format-local:'%Y%m%d.%H%M')" >> $GITHUB_ENV | ||
echo "GH_RELEASE_FILE=sgnotes-$(cat ./VERSION)-$(ldd --version | awk '/ldd/{print "-gnu-" $NF}')" >> $GITHUB_ENV | ||
- name: Install Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y \ | ||
build-essential \ | ||
libgtk-3-dev \ | ||
libgtksourceview-4-dev \ | ||
pkg-config \ | ||
clang | ||
- name: Build with GCC | ||
run: | | ||
make CC=gcc | ||
strip sgnotes | ||
mv sgnotes ${{ env.GH_RELEASE_FILE }} | ||
- name: Build with Clang | ||
run: | | ||
make CC=clang | ||
continue-on-error: true | ||
|
||
- name: Build with -Werror | ||
run: | | ||
clang `pkg-config --cflags gtk+-3.0 gtksourceview-4` -Dpver=\"1.0\" -DWITHSOURCEVIEW -c -o sgnotes.o sgnotes.c -Wall -Werror -pedantic -Wshadow --verbose | ||
continue-on-error: true | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
name: Release ci-${{ env.DATE }} | ||
body: ${{ github.event.head_commit.message }} | ||
tag_name: ${{ env.DATE }} | ||
files: | | ||
${{ env.GH_RELEASE_FILE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.