Skip to content

Commit

Permalink
Changing to cmake and Github actions
Browse files Browse the repository at this point in the history
Lets see what will break now...
  • Loading branch information
flamewing committed Jun 3, 2021
1 parent 45ce3b5 commit 538aeab
Show file tree
Hide file tree
Showing 62 changed files with 874 additions and 11,572 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: ci-linux

on:
push:
paths:
- '**'
- '!COPYING'
- '!COPYING-asm'
- '!INSTALL'
- '!**.md'
- '!.clang*'
- '!.gitignore'
- '!.gitattributes'
- '!.github/workflows/*'
- '.github/workflows/ci-linux.yml'
pull_request:
paths:
- '**'
- '!COPYING'
- '!COPYING-asm'
- '!INSTALL'
- '!**.md'
- '!.clang*'
- '!.gitignore'
- '!.gitattributes'
- '!.github/workflows/*'
- '.github/workflows/ci-linux.yml'

jobs:
ci-linux:
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [gcc, clang]
generator: [make, ninja]
include:
- compiler: gcc
cc: gcc
cxx: g++
- compiler: clang
cc: clang
cxx: clang++
- generator: make
cmake_generator: "Unix Makefiles"
- generator: ninja
cmake_generator: "Ninja"
steps:
- name: Install dependencies
run: |
sudo apt-fast update
sudo apt-fast install -y libboost-all-dev libgtkmm-3.0-dev ninja-build
- name: Checkout code
uses: actions/checkout@master
- name: Configure
env:
OVERRIDE_CC: ${{ matrix.cc }}
OVERRIDE_CXX: ${{ matrix.cxx }}
run: |
export CC=$(which $OVERRIDE_CC)
export CXX=$(which $OVERRIDE_CXX)
cmake -S . -B build -G "${{ matrix.cmake_generator }}"
- name: Build
run: |
cmake --build build -j2
59 changes: 59 additions & 0 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: ci-macos

on:
push:
paths:
- '**'
- '!COPYING'
- '!COPYING-asm'
- '!INSTALL'
- '!**.md'
- '!.clang*'
- '!.gitignore'
- '!.gitattributes'
- '!.github/workflows/*'
- '.github/workflows/ci-macos.yml'
pull_request:
paths:
- '**'
- '!COPYING'
- '!COPYING-asm'
- '!INSTALL'
- '!**.md'
- '!.clang*'
- '!.gitignore'
- '!.gitattributes'
- '!.github/workflows/*'
- '.github/workflows/ci-macos.yml'

jobs:
ci-macos:
runs-on: macos-latest
strategy:
matrix:
generator: [make, ninja, xcode]
include:
- generator: make
cmake_generator: "Unix Makefiles"
- generator: ninja
cmake_generator: "Ninja"
- generator: xcode
cmake_generator: "Xcode"
steps:
- name: Install dependencies
run: |
brew install boost gtkmm3 make ninja
- name: Checkout code
uses: actions/checkout@master
- name: Configure
run: |
export LDFLAGS="-L$(brew --prefix boost)/lib $LDFLAGS"
export CFLAGS="-I$(brew --prefix boost)/include $CFLAGS"
export CXXFLAGS="-I$(brew --prefix boost)/include $CXXFLAGS"
cmake -S . -B build -G "${{ matrix.cmake_generator }}"
- name: Build
run: |
export LDFLAGS="-L$(brew --prefix boost)/lib $LDFLAGS"
export CFLAGS="-I$(brew --prefix boost)/include $CFLAGS"
export CXXFLAGS="-I$(brew --prefix boost)/include $CXXFLAGS"
cmake --build build -j2
70 changes: 70 additions & 0 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: ci-windows

on:
push:
paths:
- '**'
- '!COPYING'
- '!COPYING-asm'
- '!INSTALL'
- '!**.md'
- '!.clang*'
- '!.gitignore'
- '!.gitattributes'
- '!.github/workflows/*'
- '.github/workflows/ci-windows.yml'
pull_request:
paths:
- '**'
- '!COPYING'
- '!COPYING-asm'
- '!INSTALL'
- '!**.md'
- '!.clang*'
- '!.gitignore'
- '!.gitattributes'
- '!.github/workflows/*'
- '.github/workflows/ci-windows.yml'

jobs:
ci-windows:
runs-on: windows-latest
strategy:
matrix:
# generator: [make, msys, vs2019]
generator: [make, msys]
architecture: [i686, x86_64]
include:
- generator: make
cmake_generator: "Unix Makefiles"
- generator: msys
cmake_generator: "MSYS Makefiles"
# - generator: vs2019
# cmake_generator: "Visual Studio 16 2019"
- architecture: i686
msystem: MINGW32
arch: i686
- architecture: x86_64
msystem: MINGW64
arch: x86_64
defaults:
run:
shell: msys2 {0}
steps:
- name: Install dependencies
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
install:
base-devel git
mingw-w64-${{ matrix.arch }}-toolchain mingw-w64-${{ matrix.arch }}-binutils
mingw-w64-${{ matrix.arch }}-ntldd mingw-w64-${{ matrix.arch }}-boost
mingw-w64-${{ matrix.arch }}-cmake mingw-w64-${{ matrix.arch }}-gtkmm3
- name: Checkout code
uses: actions/checkout@master
- name: Configure
run: |
cmake -S . -B build -G "${{ matrix.cmake_generator }}"
- name: Build
run: |
cmake --build build -j2
68 changes: 68 additions & 0 deletions .github/workflows/coverity-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: coverity-scan

on:
schedule:
- cron: "0 02 * * *" # Daily at 02:00 UTC
workflow_dispatch:

env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }}
SHA1: ${{ github.sha }}
FILE: s2ssedit-ubuntu-gcc.tgz
PROJ: flamewing/s2ssedit

jobs:
coverity-linux:
if: ${{ github.repository_owner == 'flamewing' }}
runs-on: ubuntu-latest
steps:
- name: Activity check
run: |
DATEUTC=$(curl -sL https://api.github.com/repos/flamewing/s2ssedit/commits | jq -r '[.[]][0]' | jq -r '.commit.committer.date')
TIMESTAMP=$(date --utc -d "$DATEUTC" +%s)
DAYS=$(( ($(date --utc +%s) - $TIMESTAMP) / 86400 ))
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo REPO_ALIVE=true >> $GITHUB_ENV
else
if [ $DAYS -gt 0 ]; then
echo REPO_ALIVE=false >> $GITHUB_ENV
else
echo REPO_ALIVE=true >> $GITHUB_ENV
fi
fi
- name: Install dependencies
if: ${{ env.REPO_ALIVE == 'true' }} == 'true'
run: |
sudo apt-fast update
sudo apt-fast install -y libboost-all-dev
- name: Download Coverity Build Tool
if: ${{ env.REPO_ALIVE == 'true' }} == 'true'
run: |
wget -q https://scan.coverity.com/download/Linux --post-data "token=$TOKEN&project=$PROJ" -O /tmp/cov-analysis-linux64.tar.gz
mkdir /tmp/cov-analysis-linux64
tar xzf /tmp/cov-analysis-linux64.tar.gz --strip 1 -C /tmp/cov-analysis-linux64
- name: Checkout code
if: ${{ env.REPO_ALIVE == 'true' }} == 'true'
uses: actions/checkout@master
- name: Configure
if: ${{ env.REPO_ALIVE == 'true' }} == 'true'
run: |
cmake -S . -B build -G 'Unix Makefiles'
- name: Build with cov-build
if: ${{ env.REPO_ALIVE == 'true' }} == 'true'
run: |
export PATH=/tmp/cov-analysis-linux64/bin:$PATH
cov-build --dir cov-int cmake --build build -j2
- name: Submit the result to Coverity Scan
if: ${{ env.REPO_ALIVE == 'true' }} == 'true'
run: |
tar czvf $FILE cov-int
curl \
--form project=$PROJ \
--form token=$TOKEN \
--form email=$EMAIL \
--form file=@$FILE \
--form version=master \
--form description="$SHA1" \
https://scan.coverity.com/builds?project=$PROJ
18 changes: 18 additions & 0 deletions .github/workflows/released.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: released

on:
release:
types: [published]

jobs:
virustotal:
runs-on: ubuntu-latest
steps:
- name: VirusTotal Scan
uses: crazy-max/ghaction-virustotal@v2
with:
vt_api_key: ${{ secrets.VT_API_KEY }}
github_token: ${{ github.token }}
update_release_body: true
files: |
.exe$
Loading

0 comments on commit 538aeab

Please sign in to comment.