Skip to content

Commit

Permalink
Merge nohal/ci_update
Browse files Browse the repository at this point in the history
  • Loading branch information
keesverruijt committed Aug 8, 2024
2 parents d738fdb + d1b32e4 commit 344f7d8
Show file tree
Hide file tree
Showing 41 changed files with 1,010 additions and 817 deletions.
54 changes: 14 additions & 40 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,6 @@ flatpak-steps: &flatpak-steps
- run: ci/git-push.sh /build-flatpak

jobs:
build-buster:
docker:
- image: circleci/buildpack-deps:bullseye-scm
environment:
- OCPN_TARGET: bullseye
- CMAKE_BUILD_PARALLEL_LEVEL: 2
steps:
- checkout
- run: ci/circleci-build-buster.sh
- run: sh -c "ci/maybe-push-upload.sh"

build-buster-armhf:
machine:
image: ubuntu-2004:202101-01
resource_class: arm.medium
environment:
- CMAKE_BUILD_PARALLEL_LEVEL: 2
steps:
- checkout
- run: ci/circleci-build-buster-armhf.sh
- run: ci/maybe-push-upload.sh

build-bullseye:
docker:
- image: circleci/buildpack-deps:bullseye-scm
Expand All @@ -66,7 +44,7 @@ jobs:

build-bullseye-armhf:
machine:
image: ubuntu-2004:202101-01
image: ubuntu-2204:current
resource_class: arm.medium
environment:
- TARGET_TUPLE: debian;11;armhf
Expand All @@ -80,7 +58,7 @@ jobs:

build-bullseye-wx32-armhf:
machine:
image: ubuntu-2004:202101-01
image: ubuntu-2204:current
resource_class: arm.medium
environment:
- TARGET_TUPLE: debian-wx32;11;armhf
Expand All @@ -96,7 +74,7 @@ jobs:

build-bullseye-arm64:
machine:
image: ubuntu-2004:2022.04.1
image: ubuntu-2204:current
resource_class: arm.medium
environment:
- OCPN_TARGET: bullseye
Expand All @@ -110,7 +88,7 @@ jobs:

build-bullseye-wx32-arm64:
machine:
image: ubuntu-2004:2022.04.1
image: ubuntu-2204:current
resource_class: arm.medium
environment:
- OCPN_TARGET: bullseye
Expand All @@ -126,7 +104,7 @@ jobs:

build-bookworm:
machine:
image: ubuntu-2004:2022.04.1
image: ubuntu-2204:current
resource_class: medium
environment:
- OCPN_TARGET: bookworm
Expand All @@ -140,7 +118,7 @@ jobs:

build-bookworm-arm64:
machine:
image: ubuntu-2004:2022.04.1
image: ubuntu-2204:current
resource_class: arm.medium
environment:
- OCPN_TARGET: bookworm
Expand All @@ -154,7 +132,7 @@ jobs:

build-bookworm-armhf:
machine:
image: ubuntu-2004:202101-01
image: ubuntu-2204:current
resource_class: arm.medium
environment:
- TARGET_TUPLE: debian;12;armhf
Expand All @@ -168,7 +146,7 @@ jobs:

build-flatpak-arm64:
machine:
image: ubuntu-2004:202101-01
image: ubuntu-2204:current
resource_class: arm.medium
environment:
- OCPN_TARGET: flatpak-arm64
Expand All @@ -182,7 +160,7 @@ jobs:

build-flatpak-x86:
machine:
image: ubuntu-2004:202010-01
image: ubuntu-2204:current
environment:
- OCPN_TARGET: flatpak
- CMAKE_BUILD_PARALLEL_LEVEL: 2
Expand All @@ -195,20 +173,22 @@ jobs:

build-macos:
macos:
xcode: "13.4.1"
xcode: "15.2.0"
environment:
- OCPN_TARGET: macos
- CMAKE_BUILD_PARALLEL_LEVEL: 2
steps:
- checkout
- run: sudo chmod go+w /usr/local
- restore_cache:
key: "{{checksum \"build-deps/macos-cache-stamp\"}}\
key: "new-{{checksum \"build-deps/macos-cache-stamp\"}}\
-{{checksum \"build-deps/macos-deps\"}}\
-{{checksum \"cmake/MacosWxwidgets.cmake\"}}\
-{{checksum \"ci/circleci-build-macos.sh\"}}"
- run: ci/circleci-build-macos.sh
- save_cache:
key: "{{checksum \"build-deps/macos-cache-stamp\"}}\
key: "new-{{checksum \"build-deps/macos-cache-stamp\"}}\
-{{checksum \"build-deps/macos-deps\"}}\
-{{checksum \"cmake/MacosWxwidgets.cmake\"}}\
-{{checksum \"ci/circleci-build-macos.sh\"}}"
paths:
Expand Down Expand Up @@ -295,9 +275,3 @@ workflows:

- build-bookworm:
<<: *std-filters

- build-buster:
<<: *std-filters

- build-buster-armhf:
<<: *std-filters
66 changes: 66 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
# yamllint disable rule:line-length
name: Linux build

on:
push:
branches:
- master
- ci_update
paths-ignore:
- 'manual/**'
pull_request:
branches:
- master
paths-ignore:
- 'manual/**'

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build:
runs-on: ${{ matrix.runner }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu latest wxGTK 3
runner: ubuntu-latest
cmake_generator: Unix Makefiles

env:
wxGTK_VERSION: ${{ matrix.gtk_version && matrix.gtk_version || 3 }}

# Use bash as the shell, even under MSW where the default is PowerShell.
defaults:
run:
shell: bash

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

- name: Before build
run: |
./ci/github-pre-build.sh
env:
USE_HOMEBREW: ${{ matrix.use_homebrew && matrix.use_homebrew || 0 }}

- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{ matrix.cmake_defines }}

- name: Build
run: cmake --build build --config ${{env.BUILD_TYPE}}

- name: Test
if: runner.os != 'Linux'
# TODO: The tests do not work in headless Linux containers (GTK crashes) with wxWidgets 3.0 available in Ubuntu
# They seem to be fine with wx 3.1 though, so we will just remove the condition "later" when wx3.2 time comes
# On Windows, we would need opencpn.exe in the worjing directory to run the tests (and wxWidgets libs in the path)
working-directory: build
run: ctest -C ${{env.BUILD_TYPE}}
...
99 changes: 99 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
# yamllint disable rule:line-length
name: macOS build

on:
push:
branches:
- '*'
paths-ignore:
- 'manual/**'
tags:
- '*'
pull_request:
branches:
- '*'
paths-ignore:
- 'manual/**'

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build:
runs-on: ${{ matrix.runner }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: macOS 'latest' Homebrew wxOSX
runner: macos-latest
cmake_generator: Xcode
cmake_defines: -DCMAKE_CXX_STANDARD=17
use_homebrew: 1
push_cloudsmith: 0
- name: macOS 14 Homebrew wxOSX
runner: macos-14
cmake_generator: Ninja
cmake_defines: -DCMAKE_CXX_STANDARD=17
use_homebrew: 1
push_cloudsmith: 0
- name: macOS 13 Homebrew wxOSX
runner: macos-13
cmake_generator: Ninja
cmake_defines: -DCMAKE_CXX_STANDARD=17
use_homebrew: 1
push_cloudsmith: 0
#- name: macOS 11 wxOSX
# runner: macos-11
# cmake_generator: Xcode
# cmake_defines: -DCMAKE_CXX_STANDARD=11 -DwxWidgets_CONFIG_EXECUTABLE=/tmp/wx322-2_opencpn50_macos1010/bin/wx-config -DwxWidgets_CONFIG_OPTIONS="--prefix=/tmp/wx322-2_opencpn50_macos1010"
# push_cloudsmith: 1
#- name: macOS 10.15 wxOSX
# runner: macos-10.15
# cmake_generator: Xcode
# cmake_defines: -DCMAKE_CXX_STANDARD=11 -DwxWidgets_CONFIG_EXECUTABLE=/tmp/wx322-2_opencpn50_macos1010/bin/wx-config -DwxWidgets_CONFIG_OPTIONS="--prefix=/tmp/wx322-2_opencpn50_macos1010"

env:
wxGTK_VERSION: ${{ matrix.gtk_version && matrix.gtk_version || 3 }}
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}

# Use bash as the shell, even under MSW where the default is PowerShell.
defaults:
run:
shell: bash

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

- name: Before build
run: |
./ci/github-pre-build.sh
env:
USE_HOMEBREW: ${{ matrix.use_homebrew && matrix.use_homebrew || 0 }}

- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{ matrix.cmake_defines }}

- name: Build
run: cmake --build build --config ${{env.BUILD_TYPE}}

- name: Upload to Cloudsmith
if: matrix.push_cloudsmith == 1
run: |
./upload.sh
working-directory: build
env:
UPLOAD_CLOUDSMITH: ${{ matrix.push_cloudsmith }}

- name: Test
# TODO: The tests do not work in headless Linux containers (GTK crashes) with wxWidgets 3.0 available in Ubuntu
# They seem to be fine with wx 3.1 though, so we will just remove the condition "later" when wx3.2 time comes
# On Windows, we would need opencpn.exe in the worjing directory to run the tests (and wxWidgets libs in the path)
working-directory: build
run: ctest -C ${{env.BUILD_TYPE}}
...
74 changes: 74 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
# yamllint disable rule:line-length
name: Windows 32bit build

on:
push:
branches:
- master
- ci_update
paths-ignore:
- 'manual/**'
tags:
- '*'
pull_request:
branches:
- master
paths-ignore:
- 'manual/**'

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}


jobs:
build:
runs-on: ${{ matrix.runner }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: Windows MSVC
runner: windows-latest
no_sudo: 1
# TODO: Tests don't link on Windows, investigate and fix later
cmake_defines: -T v143 -DCMAKE_GENERATOR_PLATFORM=win32 -DWITH_TESTS=OFF -DCMAKE_CXX_STANDARD=17

env:
wxGTK_VERSION: ${{ matrix.gtk_version && matrix.gtk_version || 3 }}

# Use bash as the shell, even under MSW where the default is PowerShell.
defaults:
run:
shell: bash

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

# required for CMake to find Ninja
- name: "[Windows] Set up MSVC Developer Command Prompt"
if: runner.os == 'Windows'
uses: seanmiddleditch/gha-setup-vsdevenv@v3
with:
host_arch: x86
arch: win32

- name: "[Windows] Dependencies, configure, build"
if: runner.os == 'Windows'
run: |
call buildwin/win_deps.bat
cmake -A win32 -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{ matrix.cmake_defines }}
cmake --build build --config ${{env.BUILD_TYPE}}
shell: cmd
- name: "[Windows] Publish to Cloudsmith"
if: runner.os == 'Windows'
run: |
cd build
.\upload.bat
shell: cmd
...
Loading

0 comments on commit 344f7d8

Please sign in to comment.