Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI configuration (linux) #2

Merged
merged 1 commit into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: linux

on:
pull_request:
types: [opened, synchronize]
branches:
- "*"
# Allow manual trigger for this workflow.
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
name: linux
defaults:
run:
shell: "bash -el {0}"

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

# Native build steps:
- name: Add repositories for GCC
run: sudo apt-add-repository ppa:ubuntu-toolchain-r/test

- name: Install GCC
run: |
sudo apt update
sudo apt install g++-13 cmake ninja-build

- name: Create build directory
run: cmake -E make_directory ${{runner.workspace}}/build-native

- name: Configure native build
env:
CC: gcc-13
CXX: g++-13
working-directory: ${{runner.workspace}}/build-native
run: |
cmake ${{github.workspace}} -DCMAKE_BUILD_TYPE=RelWithDebInfo -Wno-deprecated -G Ninja

- name: Run native build
working-directory: ${{runner.workspace}}/build-native
run: |
threads=`nproc`
cmake --build . --config RelWithDebInfo --parallel $threads

- name: Run CTest
working-directory: ${{runner.workspace}}/build-native
run: ctest --output-on-failure

# Emscripten build steps:
- name: Install emscripten
working-directory: ${{runner.temp}}
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
git checkout 3.1.70
./emsdk install latest
./emsdk activate latest

- name: Create emscripten build directory
run: cmake -E make_directory ${{runner.workspace}}/build-emscripten

- name: Configure emscripten build
working-directory: ${{runner.workspace}}/build-emscripten
run: |
source ${{runner.temp}}/emsdk/emsdk_env.sh
emcmake cmake ${{github.workspace}} -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_EMSCRIPTEN=ON

- name: Run emscripten build
working-directory: ${{runner.workspace}}/build-emscripten
run: |
threads=`nproc`
source ${{runner.temp}}/emsdk/emsdk_env.sh
emmake make -j $threads

# Node build steps:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install node packages
working-directory: ${{github.workspace}}/viz
run: npm ci

- name: Run npm build
working-directory: ${{github.workspace}}/viz
run: npm run build -- --mode production

# Pre-commit steps.
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install pre-commit
run: python -m pip install pre-commit

- name: Pre-commit checks
working-directory: ${{github.workspace}}
run: pre-commit run --all-files
1 change: 1 addition & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[settings]
known_first_party=pypendulum
src_paths=symbolic,model