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

update test workflows and related codes. #11

Merged
merged 15 commits into from
Jul 1, 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
82 changes: 82 additions & 0 deletions .github/workflows/build-classic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Build Classic

on:
push:
branches:
- master

pull_request:
branches:
- master

jobs:
build-classic:
if: >-
! contains(toJSON(github.event.commits.*.message), '[skip ci]') &&
! contains(toJSON(github.event.commits.*.message), '[skip github]')

runs-on: ubuntu-latest

strategy:
fail-fast: false

matrix:
gcc_version: [ '4.8.5' ]
cmake_version: [ '3.9.6' ]
build_type: [ Release ]
include:
- gcc_version: '4.8.5'
libuv_version: '1.44.2'

name: "In Container GCC ${{matrix.gcc_version}} ${{matrix.build_type}}"

container:
image: gcc:${{matrix.gcc_version}}

steps:
- uses: actions/checkout@v1
with:
submodules: recursive

- name: Set output
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

- name: Download CMake
run: >-
wget --no-check-certificate
https://github.com/Kitware/CMake/releases/download/v${{matrix.cmake_version}}/cmake-${{matrix.cmake_version}}-linux-x86_64.tar.gz

- name: Install CMake
run: |
tar -xvf cmake-${{matrix.cmake_version}}-linux-x86_64.tar.gz
echo "`pwd`/cmake-${{matrix.cmake_version}}-Linux-x86_64/bin" >> $GITHUB_PATH

- name: CMake & GCC Information
run: |
cmake --version
gcc --version
g++ --version

- name: Checkout libuv
run: |
cd libuv
git checkout "v${{matrix.libuv_version}}"
cd ..

- name: Configure
run: |
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DSTD=11 ..
cd ..

- name: Build
run: |
cmake --build build --config ${{ matrix.build_type }}

- name: Test
working-directory: build
run: ctest --output-on-failure --build-config ${{ matrix.build_type }}
58 changes: 58 additions & 0 deletions .github/workflows/build-gcc-std.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build GCC-std

on:
push:
branches:
- master

pull_request:
branches:
- master

jobs:
build-gcc-std:
if: >-
! contains(toJSON(github.event.commits.*.message), '[skip ci]') &&
! contains(toJSON(github.event.commits.*.message), '[skip github]')

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false

matrix:
os: [ ubuntu-latest ]
build_type: [ Release ]
std: [ '17', '14', '11' ]

name: "On ${{matrix.os}} gcc -std=c++${{matrix.std}}"

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

- uses: friendlyanon/fetch-core-count@v1
id: cores

- name: Set output
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

- name: Configure
run: >
cmake -B "${{ steps.strings.outputs.build-output-dir }}"
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DSTD=${{ matrix.std }}
-S "${{ github.workspace }}"

- name: Build
run: >-
cmake --build "${{ steps.strings.outputs.build-output-dir }}"
--config ${{ matrix.build_type }}

- name: Test
working-directory: "${{ steps.strings.outputs.build-output-dir }}"
run: ctest --output-on-failure --build-config ${{ matrix.build_type }}
70 changes: 70 additions & 0 deletions .github/workflows/build-gcc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Build Multi-GCC

on:
push:
branches:
- master

pull_request:
branches:
- master

jobs:
build-gcc:
if: >-
! contains(toJSON(github.event.commits.*.message), '[skip ci]') &&
! contains(toJSON(github.event.commits.*.message), '[skip github]')

runs-on: ubuntu-20.04

strategy:
fail-fast: false

matrix:
gcc_version: [ 'latest', '12', '11', '10', '9', '8', '7', '6', '5' ]
build_type: [ Release ]

name: "In Container GCC ${{matrix.gcc_version}} ${{matrix.build_type}}"

container:
image: gcc:${{matrix.gcc_version}}
options: -v /usr/local:/host_usr_local

steps:
- uses: actions/checkout@v1
with:
submodules: recursive

- uses: friendlyanon/fetch-core-count@v1
id: cores

- name: Set output
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

- name: Mount CMake
run: echo "/host_usr_local/bin" >> $GITHUB_PATH

- name: CMake & GCC Information
run: |
cmake --version
gcc --version
g++ --version

- name: Configure
run: >-
cmake -B build
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S .

- name: Build
run: >-
cmake --build build
--config ${{ matrix.build_type }}
-- -j ${{steps.cores.outputs.count}}

- name: Test
working-directory: build
run: ctest --output-on-failure --build-config ${{ matrix.build_type }}
59 changes: 59 additions & 0 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build MacOS

on:
push:
branches:
- master

pull_request:
branches:
- master

jobs:
build-macos:
if: >-
! contains(toJSON(github.event.commits.*.message), '[skip ci]') &&
! contains(toJSON(github.event.commits.*.message), '[skip github]')

runs-on: ${{matrix.os}}

strategy:
matrix:
os: [ 'macos-12' ]
xcode: [ '14.1' ]
build_type: [ Release ]

env:
DEVELOPER_DIR: /Applications/Xcode_${{matrix.xcode}}.app/Contents/Developer

name: "On ${{matrix.os}} Xcode ${{matrix.xcode}} ${{matrix.build_type}}"

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

- uses: friendlyanon/fetch-core-count@v1
id: cores

- name: Set output
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

- name: Configure
run: >-
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}

- name: Build
run: >-
cmake --build ${{ steps.strings.outputs.build-output-dir }}
--config ${{ matrix.build_type }}
-- -j ${{steps.cores.outputs.count}}

- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: ctest --output-on-failure --build-config ${{ matrix.build_type }}
72 changes: 72 additions & 0 deletions .github/workflows/build-mingw.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build MinGW

on:
push:
branches:
- master

pull_request:
branches:
- master

jobs:
build-mingw:
if: >-
! contains(toJSON(github.event.commits.*.message), '[skip ci]') &&
! contains(toJSON(github.event.commits.*.message), '[skip github]')

runs-on: ${{matrix.os}}

defaults:
run:
shell: msys2 {0}

strategy:
fail-fast: false

matrix:
os: [ windows-latest ]
build_type: [ Release ]
config:
- msystem: "MINGW64"
install: >-
git mingw-w64-x86_64-cmake
mingw-w64-x86_64-gcc
mingw-w64-x86_64-ninja

name: "On ${{matrix.os}} ${{matrix.config.msystem}} ${{matrix.build_type}}"

env:
CMAKE_GENERATOR: 'Ninja'

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

- uses: msys2/setup-msys2@v2
with:
update: true
msystem: ${{matrix.config.msystem}}
install: ${{matrix.config.install}}

- name: Set output
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

- name: Configure
run: >-
cmake -B "${{ steps.strings.outputs.build-output-dir }}"
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S "${{ github.workspace }}"

- name: Build
run: >-
cmake --build "${{ steps.strings.outputs.build-output-dir }}"
--config ${{ matrix.build_type }}

- name: Test
working-directory: "${{ steps.strings.outputs.build-output-dir }}"
run: ctest --output-on-failure --build-config ${{ matrix.build_type }}
Loading
Loading