Skip to content

Commit

Permalink
feat ci: added initial github CI
Browse files Browse the repository at this point in the history
Signed-off-by: John Sanpe <[email protected]>
  • Loading branch information
sanpeqf committed Feb 27, 2024
1 parent f144e99 commit 4a3eca6
Show file tree
Hide file tree
Showing 5 changed files with 213 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: analyse on codeql

on:
repository_dispatch:
workflow_dispatch:
push:
pull_request:
schedule:
- cron: '43 23 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]

steps:
- name: checkout
uses: actions/checkout@v3
- name: install dependencies
run: |
sudo apt update
sudo apt install git cmake make clang
- name: update submodule
run: |
git submodule update --init --recursive
- name: initialize codeql
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: autobuild
uses: github/codeql-action/autobuild@v2
- name: perform analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
41 changes: 41 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: build default on macos

on:
repository_dispatch:
workflow_dispatch:
push:
pull_request:
schedule:
- cron: '0 */2 * * *'

env:
BUILD_TYPE: Release

jobs:
build:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]

steps:
- name: checkout
uses: actions/checkout@v3
- name: install dependencies
run: |
brew update
brew install git cmake make ccache
- name: update submodule
run: |
git submodule update --init --recursive
- name: configure cmake
run: |
cmake -B ${{github.workspace}}/build \
-D CMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install \
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-D CMAKE_C_COMPILER=/usr/local/opt/ccache/libexec/clang
- name: make
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: install
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -- install
42 changes: 42 additions & 0 deletions .github/workflows/ubuntu-clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: build default on ubuntu clang

on:
repository_dispatch:
workflow_dispatch:
push:
pull_request:
schedule:
- cron: '0 */2 * * *'

env:
BUILD_TYPE: Release

jobs:
build:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]

steps:
- name: checkout
uses: actions/checkout@v3
- name: install dependencies
run: |
sudo apt update
sudo apt install git cmake make clang ccache
- name: update submodule
run: |
git submodule update --init --recursive
- name: configure cmake
run: |
cmake -B ${{github.workspace}}/build \
-D CMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install \
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-D CMAKE_C_COMPILER=/usr/lib/ccache/clang
- name: make
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: install
working-directory: ${{github.workspace}}/build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -- install
42 changes: 42 additions & 0 deletions .github/workflows/ubuntu-gcc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: build default on ubuntu gcc

on:
repository_dispatch:
workflow_dispatch:
push:
pull_request:
schedule:
- cron: '0 */2 * * *'

env:
BUILD_TYPE: Release

jobs:
build:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]

steps:
- name: checkout
uses: actions/checkout@v3
- name: install dependencies
run: |
sudo apt update
sudo apt install git cmake make gcc ccache
- name: update submodule
run: |
git submodule update --init --recursive
- name: configure cmake
run: |
cmake -B ${{github.workspace}}/build \
-D CMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install \
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-D CMAKE_C_COMPILER=/usr/lib/ccache/gcc
- name: make
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: install
working-directory: ${{github.workspace}}/build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -- install
45 changes: 45 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: build default on windows

on:
repository_dispatch:
workflow_dispatch:
push:
pull_request:
schedule:
- cron: '0 */2 * * *'

env:
BUILD_TYPE: Debug

jobs:
build:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
defaults:
run:
shell: msys2 {0}

steps:
- name: checkout
uses: actions/checkout@v3
- name: install dependencies
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: git cmake make gcc
- name: update submodule
run: |
git submodule update --init --recursive
- name: configure cmake
run: |
cmake -B build \
-D CMAKE_INSTALL_PREFIX=build/install \
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: make
run: cmake --build build --config ${{env.BUILD_TYPE}}
- name: install
run: cmake --build build --config ${{env.BUILD_TYPE}} -- install

0 comments on commit 4a3eca6

Please sign in to comment.