Skip to content

Commit

Permalink
update build ci
Browse files Browse the repository at this point in the history
  • Loading branch information
PredatorCZ committed Jul 19, 2024
1 parent 792efa0 commit 14da94a
Showing 1 changed file with 24 additions and 40 deletions.
64 changes: 24 additions & 40 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -1,104 +1,88 @@
name: build

on: [push]
on:
push:

env:
BUILD_TYPE: Release
SK_VERSION: nover

jobs:
build-linux:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- name: GCC 10 & Artifacts
CC: gcc-10
CXX: g++-10
artifacts: true
- name: Clang 12 & ODR
CC: clang-12
CXX: clang++-12
use-odr: true
toolset:
runs-on: ubuntu-22.04

env:
CC: ${{matrix.CC}}
CXX: ${{matrix.CXX}}
ODR_TEST: ${{matrix.odr-test == true}}
CC: gcc-12
CXX: g++-12

defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Configure stuff
run: |
mkdir ${{github.workspace}}/build
cd ${{github.workspace}}/build
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DODR_TEST=$ODR_TEST -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/tmp ..
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/tmp ..
echo "SK_VERSION=$(cat version)" >> $GITHUB_ENV
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . -j 6

- name: Install
if: ${{matrix.artifacts == true}}
working-directory: ${{github.workspace}}/build
run: |
cmake --build . --target install
cd ../tmp
install -D ../LICENSE share/doc/insomnia-toolset/LICENSE.md
install -D ../README.md share/doc/insomnia-toolset/README.md
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure
mv ../LICENSE .
mv ../README.md .
tar -cvaf ../Insomnia-v${{env.SK_VERSION}}-linux-amd64.tar.xz .
- name: Upload Artifacts
if: ${{matrix.artifacts == true}}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: InsomniaToolset-linux-amd64
path: ${{github.workspace}}/tmp
name: Insomnia-linux-amd64
path: ${{github.workspace}}/Insomnia-v${{env.SK_VERSION}}-linux-amd64.tar.xz
retention-days: 5

build-widle:
runs-on: windows-2019
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Configure stuff
run: |
choco install ninja
mkdir ${{github.workspace}}/build
cd ${{github.workspace}}/build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{github.workspace}} ..
echo "SK_VERSION=$(Get-Content -Path ./version)" >> $env:GITHUB_ENV
env:
CC: clang
CXX: clang++
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . -j 6

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure

- name: Install
run: |
cmake --build build --target install
copy LICENSE bin/LICENSE.md
copy LICENSE bin/LICENSE
copy README.md bin/README.md
- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: InsomniaToolset-win64
name: Insomnia-v${{env.SK_VERSION}}-win64
path: ${{github.workspace}}/bin
retention-days: 5

0 comments on commit 14da94a

Please sign in to comment.