Skip to content

Commit

Permalink
ci: update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Jun 13, 2024
1 parent b4496c8 commit 2e34651
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 83 deletions.
100 changes: 48 additions & 52 deletions .github/workflows/amd64_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,55 @@ jobs:
native:
strategy:
matrix:
build: [
["Unix Makefiles", "Release"],
["Ninja", "Release"],
["Ninja Multi-Config", "Release"]
cmake: [
{generator: "Unix Makefiles", config: "Release"},
{generator: "Ninja", config: "Release"},
{generator: "Ninja Multi-Config", config: "Release"}
]
fail-fast: false
name: Ubuntu • ${{ matrix.build[0] }}
name: Ubuntu • ${{ matrix.cmake.generator }}
runs-on: ubuntu-latest
env:
GENERATOR: ${{ matrix.build[0] }}
BUILD_TYPE: ${{ matrix.build[1] }}
steps:
- uses: actions/checkout@v4
- name: Install Ninja
run: |
sudo apt-get update
sudo apt-get install ninja-build
- name: Uninstall preinstalled swig3.0
run: |
swig -version;
sudo apt remove -y swig swig3.0
- name: Install SWIG 4.0.2
run: |
wget "https://github.com/swig/swig/archive/refs/tags/v4.0.2.tar.gz" -O swig-4.0.2.tar.gz;
tar xvf swig-4.0.2.tar.gz;
rm swig-4.0.2.tar.gz;
cd swig-4.0.2;
./autogen.sh;
./configure --prefix=/usr;
make -j8;
sudo make install;
cd ..;
rm -rf swig-4.0.2;
- name: Check swig
run: swig -version
# Install .NET SDKs
- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 3.1.x
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
- name: Check dotnet
run: dotnet --info
- name: Check cmake
run: cmake --version
- name: Configure
run: cmake -S. -Bbuild -G "$GENERATOR" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" -DCMAKE_INSTALL_PREFIX=install
- name: Build
run: cmake --build build --config "$BUILD_TYPE" --target all -v
- name: Test
run: CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --config "$BUILD_TYPE" --target test -v
- name: Install
run: cmake --build build --config "$BUILD_TYPE" --target install -v
- uses: actions/checkout@v4
- name: Install Ninja
run: |
sudo apt update
sudo apt install -y ninja-build
- name: Install SWIG
run: |
sudo apt install -y swig
swig -version
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
- name: Check dotnet
run: dotnet --info
- name: Check cmake
run: cmake --version
- name: Configure
run: >
cmake -S. -Bbuild
-G "${{ matrix.cmake.generator }}"
-DCMAKE_BUILD_TYPE=${{ matrix.cmake.config }}
-DCMAKE_INSTALL_PREFIX=install
- name: Build
run: >
cmake --build build
--config ${{ matrix.cmake.config }}
--target all
-v -j2
- name: Test
run: >
CTEST_OUTPUT_ON_FAILURE=1
cmake --build build
--config ${{ matrix.cmake.config }}
--target test
-v
- name: Install
run: >
cmake --build build
--config ${{ matrix.cmake.config }}
--target install
-v
-- DESTDIR=install
80 changes: 49 additions & 31 deletions .github/workflows/amd64_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,55 @@ name: amd64 Windows

on: [push, pull_request, workflow_dispatch]

# Building using the github runner environement directly.
jobs:
# Building using the github runner environement directly.
visual-studio:
native:
strategy:
matrix:
cmake: [
{generator: "Visual Studio 17 2022", config: Release, build_target: ALL_BUILD, test_target: RUN_TESTS, install_target: INSTALL},
]
fail-fast: false
name: Windows • ${{ matrix.cmake.generator }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install SWIG 4.0.2
run: |
(New-Object System.Net.WebClient).DownloadFile("http://prdownloads.sourceforge.net/swig/swigwin-4.0.2.zip","swigwin-4.0.2.zip");
Expand-Archive .\swigwin-4.0.2.zip .;
echo "$((Get-Item .).FullName)/swigwin-4.0.2" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Check swig
run: swig -version
# Install .NET SDKs
- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 3.1.x
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
- name: Check dotnet
run: dotnet --info
- name: Check cmake
run: cmake --version
- name: Configure
run: cmake -S. -Bbuild -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES=Release -DCMAKE_INSTALL_PREFIX=install
- name: Build
run: cmake --build build --config Release --target ALL_BUILD -v
- name: Test
run: cmake --build build --config Release --target RUN_TESTS -v
- name: Install
run: cmake --build build --config Release --target INSTALL -v
- uses: actions/checkout@v4
- name: Install SWIG 4.2.1
run: |
(New-Object System.Net.WebClient).DownloadFile("http://prdownloads.sourceforge.net/swig/swigwin-4.2.1.zip","swigwin-4.2.1.zip");
Expand-Archive .\swigwin-4.2.1.zip .;
echo "$((Get-Item .).FullName)/swigwin-4.2.1" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Check swig
run: swig -version
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
- name: Check dotnet
run: dotnet --info
- name: Check cmake
run: cmake --version
- name: Configure
run: >
cmake -S. -Bbuild
-G "${{ matrix.cmake.generator }}"
-DCMAKE_CONFIGURATION_TYPES=${{ matrix.cmake.config }}
-DCMAKE_INSTALL_PREFIX=install
- name: Build
run: >
cmake --build build
--config ${{ matrix.cmake.config }}
--target ${{ matrix.cmake.build_target }}
-v -j2
- name: Test
run: >
cmake --build build
--config ${{ matrix.cmake.config }}
--target ${{ matrix.cmake.test_target }}
-v
- name: Install
run: >
cmake --build build
--config ${{ matrix.cmake.config }}
--target ${{ matrix.cmake.install_target }}
-v

0 comments on commit 2e34651

Please sign in to comment.