Skip to content

Commit

Permalink
Merge pull request #1 from Totto16/update_ci
Browse files Browse the repository at this point in the history
 Update CI
  • Loading branch information
Totto16 authored Oct 1, 2024
2 parents cef69b5 + 9ac4533 commit 22686db
Show file tree
Hide file tree
Showing 5 changed files with 4,138 additions and 36 deletions.
48 changes: 23 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build CI

on:
push:
branches: ["main"]
branches: ['main']
pull_request:
workflow_dispatch:

Expand All @@ -23,29 +23,27 @@ jobs:
os: ubuntu
os-version: 24.04

- name: MacOS
- name: MacOS
os: macos
os-version: 13

- name: MacOS (Arm64)
os: macos
os-version: 14


steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"
fetch-depth: '0'

- uses: actions/checkout@v4
name: Checkout OOPetris main repo
name: Checkout OOPetris main repo
with:
fetch-depth: "0"
fetch-depth: '0'
repository: OpenBrickProtocolFoundation/oopetris
ref: main
path: ./oopetris
submodules: false


- name: Setup MSVC (Windows)
if: matrix.config.os == 'windows'
Expand All @@ -65,7 +63,8 @@ jobs:
if: matrix.config.os == 'macos'
run: |
brew update
brew install llvm@18
# TODO annotate with lld@19, after that is accepted, we don't want to use lld@20 without manually updating it !
brew install llvm@19 lld
echo "$(brew --prefix)/opt/llvm/bin" >> $GITHUB_PATH
echo "LDFLAGS=-L$(brew --prefix)/opt/llvm/lib -L$(brew --prefix)/opt/llvm/lib/c++ -Wl,-rpath,$(brew --prefix)/opt/llvm/lib/c++" >> "$GITHUB_ENV"
echo "CPPFLAGS=-I$(brew --prefix)/opt/llvm/include" >> "$GITHUB_ENV"
Expand All @@ -77,11 +76,11 @@ jobs:
echo "OBJC_LD=lld" >> "$GITHUB_ENV"
- name: Setup meson (MacOS)
if: matrix.config.os == 'macos'
if: matrix.config.os == 'macos'
run: |
brew update
brew install meson
# NOTE: meson has no dependencies, so --break-system-packages doesn't really break anything!
- name: Setup meson
if: matrix.config.os != 'macos'
Expand All @@ -92,41 +91,41 @@ jobs:
if: matrix.config.os == 'ubuntu'
run: |
sudo apt-get update
sudo apt-get install ninja-build -y
sudo apt-get install ninja-build -y --no-install-recommends
sudo pip install meson --break-system-packages
- name: Fix pkg-config (Windows)
if: matrix.config.os == 'windows'
run: |
Remove-Item -Path C:\Strawberry\ -Recurse
Remove-Item -Path C:\Strawberry\ -Recurse
choco install pkgconfiglite
echo "PKG_CONFIG_PATH=C:/lib/pkgconfig" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Configure
run: |
cd oopetris
meson setup build -Dbuildtype=release -Ddefault_library=static -Dclang_libcpp=${{ matrix.config.os == 'macos' && 'enabled' || 'disabled' }} -Donly_build_libs=true ${{ matrix.config.os == 'windows' && '-Db_vscrt=static_from_buildtype' || '' }}
run: |
cd oopetris
meson setup build -Dbuildtype=release -Ddefault_library=static -Dclang_libcpp=${{ matrix.config.os == 'macos' && 'enabled' || 'disabled' }} -Donly_build_libs=true ${{ matrix.config.os == 'windows' && '-Db_vscrt=static_from_buildtype' || '' }}
- name: Build and install Libs
if: matrix.config.os != 'ubuntu'
run: |
cd oopetris
meson install -C build
run: |
cd oopetris
meson install -C build
- name: Build and install Libs (Linux)
if: matrix.config.os == 'ubuntu'
run: |
cd oopetris
sudo meson install -C build
run: |
cd oopetris
sudo meson install -C build
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Build package
run: |
npm install -D
run: |
npm clean-install -D
npm run build --verbose
npm run test
npm pack
Expand All @@ -136,4 +135,3 @@ jobs:
with:
name: ${{ matrix.config.name }} Node.js Wrapper
path: oopetris*.tgz

2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@

node_modules/

package-lock.json

/dist
/prebuilds/
2 changes: 1 addition & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
},
"VCLinkerTool": {
"AdditionalDependencies": [
"<!@(pkg-config oopetris-recordings --libs-only-l | sed s/-l/lib/g |sed 's/\s/.a /g')", # adjust to the default setting, namely lib<name>.a via some sed magic
"<!@(pkg-config oopetris-recordings --libs-only-l | sed s/-l/lib/g |sed 's/\\s/.a /g')", # adjust to the default setting, namely lib<name>.a via some sed magic
],
},
},
Expand Down
Loading

0 comments on commit 22686db

Please sign in to comment.