Skip to content

Commit

Permalink
Merge branch 'ci/split-linux-macos' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
HuguesDelorme committed May 16, 2023
2 parents e32f59a + 78200da commit 57e36d9
Show file tree
Hide file tree
Showing 8 changed files with 235 additions and 117 deletions.
49 changes: 9 additions & 40 deletions .github/workflows/ci.yml → .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
name: CI
name: Linux

on: [push]

jobs:
ci:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]

runs-on: ${{matrix.os}}
build-linux:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: 'source'
fetch-depth: 0
lfs: 'false'

- name: Cache Qt
id: cache-qt
Expand All @@ -31,46 +22,30 @@ jobs:
with:
cached: ${{ steps.cache-qt.outputs.cache-hit }}

- name: Install OpenCascade[Ubuntu]
if: startsWith(matrix.os, 'ubuntu')
- name: Install OpenCascade
run: |
sudo apt-get -y install libocct-data-exchange-dev libocct-draw-dev
GH_CASCADE_INC_DIR=`dpkg -L libocct-foundation-dev | grep -i "Standard_Version.hxx" | sed "s/\/Standard_Version.hxx//i"`
GH_CASCADE_LIB_DIR=`dpkg -L libocct-foundation-dev | grep -i "libTKernel.so" | sed "s/\/libTKernel.so//i"`
echo "GH_CASCADE_INC_DIR=$GH_CASCADE_INC_DIR" >> $GITHUB_ENV
echo "GH_CASCADE_LIB_DIR=$GH_CASCADE_LIB_DIR" >> $GITHUB_ENV
- name: Install OpenCascade[macOS]
if: startsWith(matrix.os, 'macos')
run: |
brew install opencascade
GH_CASCADE_BASE_DIR=`brew info opencascade | grep -E -i --only-matching --max-count=1 "^(/[a-z\.\-_0-9]+)+"`
echo "GH_CASCADE_INC_DIR=$GH_CASCADE_BASE_DIR/include/opencascade" >> $GITHUB_ENV
echo "GH_CASCADE_LIB_DIR=$GH_CASCADE_BASE_DIR/lib" >> $GITHUB_ENV
- name: Get count of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores

- name: Create Build folder
run: mkdir ${{github.workspace}}/build

- name: QMake
working-directory: ${{github.workspace}}/build
- name: Build
run: |
mkdir ${{github.workspace}}/build
cd ${{github.workspace}}/build
echo CASCADE_INC_DIR=${{env.GH_CASCADE_INC_DIR}}
echo CASCADE_LIB_DIR=${{env.GH_CASCADE_LIB_DIR}}
[ ! -d $CASCADE_INC_DIR ] && echo "ERROR: OpenCascade include dir doesn't exist"
[ ! -d $CASCADE_LIB_DIR ] && echo "ERROR: OpenCascade lib dir doesn't exist"
qmake ../source CASCADE_INC_DIR=${{env.GH_CASCADE_INC_DIR}} CASCADE_LIB_DIR=${{env.GH_CASCADE_LIB_DIR}} CONFIG+=withtests
- name: Build
working-directory: ${{github.workspace}}/build
run: |
qmake .. CASCADE_INC_DIR=${{env.GH_CASCADE_INC_DIR}} CASCADE_LIB_DIR=${{env.GH_CASCADE_LIB_DIR}} CONFIG+=withtests
make -j${{steps.cpu-cores.outputs.count}}
- name: Execute Unit Tests[Ubuntu]
if: startsWith(matrix.os, 'ubuntu')
- name: Execute Unit Tests
working-directory: ${{github.workspace}}/build
env:
DISPLAY: :0
Expand All @@ -84,9 +59,3 @@ jobs:
sleep 5s
# Run tests
./mayo --runtests
- name: Execute Unit Tests[macOS]
if: startsWith(matrix.os, 'macos')
working-directory: ${{github.workspace}}/build
run: |
./mayo.app/Contents/MacOS/mayo --runtests
50 changes: 50 additions & 0 deletions .github/workflows/ci_macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: macOS

on: [push]

jobs:
build-macos:
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{ runner.os }}-QtCache

- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
cached: ${{ steps.cache-qt.outputs.cache-hit }}

- name: Install OpenCascade
run: |
brew install opencascade
GH_CASCADE_BASE_DIR=`brew info opencascade | grep -E -i --only-matching --max-count=1 "^(/[a-z\.\-_0-9]+)+"`
echo "GH_CASCADE_INC_DIR=$GH_CASCADE_BASE_DIR/include/opencascade" >> $GITHUB_ENV
echo "GH_CASCADE_LIB_DIR=$GH_CASCADE_BASE_DIR/lib" >> $GITHUB_ENV
- name: Get count of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores

- name: Build
run: |
mkdir ${{github.workspace}}/build
cd ${{github.workspace}}/build
echo CASCADE_INC_DIR=${{env.GH_CASCADE_INC_DIR}}
echo CASCADE_LIB_DIR=${{env.GH_CASCADE_LIB_DIR}}
[ ! -d $CASCADE_INC_DIR ] && echo "ERROR: OpenCascade include dir doesn't exist"
[ ! -d $CASCADE_LIB_DIR ] && echo "ERROR: OpenCascade lib dir doesn't exist"
qmake .. CASCADE_INC_DIR=${{env.GH_CASCADE_INC_DIR}} CASCADE_LIB_DIR=${{env.GH_CASCADE_LIB_DIR}} CONFIG+=withtests
make -j${{steps.cpu-cores.outputs.count}}
- name: Execute Unit Tests
working-directory: ${{github.workspace}}/build
run: |
./mayo.app/Contents/MacOS/mayo --runtests
83 changes: 83 additions & 0 deletions .github/workflows/ci_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Windows

on: [push]

jobs:
build-windows-msvc:
strategy:
matrix:
occ_version: [7.3.0, 7.4.0, 7.5.0, 7.6.0, 7.7.0]

runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{ runner.os }}-QtCache

- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
cached: ${{ steps.cache-qt.outputs.cache-hit }}

- name: Cache OpenCascade archive
id: cache-occ
uses: actions/cache@v3
with:
path: OpenCASCADE-${{matrix.occ_version}}-vc14-64.zip
key: occ-${{matrix.occ_version}}

- name: Download OpenCascade
if: steps.cache-occ.outputs.cache-hit != 'true'
uses: carlosperate/download-file-action@v2
with:
file-url: 'https://www.fougue.pro/share/bin/OpenCASCADE-${{matrix.occ_version}}-vc14-64.zip'

- name: Extract OpenCascade
shell: pwsh
run: |
Expand-Archive -Path OpenCASCADE-${{matrix.occ_version}}-vc14-64.zip -DestinationPath .
- name: Download jom.exe
uses: carlosperate/download-file-action@v2
with:
file-url: 'https://www.fougue.pro/share/bin/jom.exe'

- name: Get count of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores

- name: Create Build folder
run: mkdir ${{github.workspace}}/build

- name: Configure Compiler
uses: ilammy/msvc-dev-cmd@v1

- name: QMake
working-directory: ${{github.workspace}}/build
shell: cmd
run: |
call ..\OpenCASCADE-${{matrix.occ_version}}-vc14-64\opencascade-${{matrix.occ_version}}\env.bat
echo CSF_OCCTIncludePath=%CSF_OCCTIncludePath%
echo CSF_OCCTLibPath=%CSF_OCCTLibPath%
qmake --version
qmake ..\mayo.pro CONFIG+=release CONFIG+=withtests
- name: Build
working-directory: ${{github.workspace}}/build
run: |
..\jom.exe -j${{steps.cpu-cores.outputs.count}}
- name: Execute Unit Tests
working-directory: ${{github.workspace}}/build
shell: cmd
run: |
call ..\OpenCASCADE-${{matrix.occ_version}}-vc14-64\opencascade-${{matrix.occ_version}}\env.bat
release\mayo.exe --runtests -o utests-output.txt
more utests-output.txt
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<div align="center">

[![CI](https://github.com/fougue/mayo/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/fougue/mayo/actions/workflows/ci.yml)
[![Build status](https://ci.appveyor.com/api/projects/status/6d1w0d6gw28npxpf/branch/develop?svg=true)](https://ci.appveyor.com/project/HuguesDelorme/mayo)
[![Windows CI](https://github.com/fougue/mayo/actions/workflows/ci_windows.yml/badge.svg?branch=develop)](https://github.com/fougue/mayo/actions/workflows/ci_windows.yml)
[![Linux CI](https://github.com/fougue/mayo/actions/workflows/ci_linux.yml/badge.svg?branch=develop)](https://github.com/fougue/mayo/actions/workflows/ci_linux.yml)
[![macOS CI](https://github.com/fougue/mayo/actions/workflows/ci_macos.yml/badge.svg?branch=develop)](https://github.com/fougue/mayo/actions/workflows/ci_macos.yml)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/d51f8ca6fea34886b8308ff0246172ce)](https://www.codacy.com/gh/fougue/mayo/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=fougue/mayo&amp;utm_campaign=Badge_Grade)
[![Downloads](https://img.shields.io/github/downloads/fougue/mayo/total.svg)](https://github.com/fougue/mayo/releases)
[![License](https://img.shields.io/badge/license-BSD%202--clause-blue.svg)](https://github.com/fougue/mayo/blob/develop/LICENSE.txt)
Expand Down
63 changes: 0 additions & 63 deletions appveyor.yml

This file was deleted.

5 changes: 3 additions & 2 deletions mayo.pro
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ RC_ICONS = images/appicon.ico

OTHER_FILES += \
README.md \
appveyor.yml \
.github/workflows/ci.yml \
.github/workflows/ci_linux.yml \
.github/workflows/ci_macos.yml \
.github/workflows/ci_windows.yml \
images/credits.txt \
scripts/bump-version.rb \

Expand Down
7 changes: 0 additions & 7 deletions scripts/bump-version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,3 @@
version_pri.sub!(/(MAYO_VERSION_PAT\s*=\s*)\d+/, "\\1#{patch}")
File.open(path_version_pri, "w").write(version_pri)
puts "Bumped #{path_version_pri}"

# ../appveyor.yml
path_appveyor_yml = "#{script_dir_name}/../appveyor.yml"
appveyor_yml = File.open(path_appveyor_yml, "r").read
appveyor_yml.sub!(/(version\s*:\s*)\d+\.\d+/, "\\1#{major}.#{minor}")
File.open(path_appveyor_yml, "w").write(appveyor_yml)
puts "Bumped #{path_appveyor_yml}"
Loading

0 comments on commit 57e36d9

Please sign in to comment.