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

gh workflow: test the build matrix #869

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from
Draft
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
51 changes: 0 additions & 51 deletions .github/workflows/ccpp.yml

This file was deleted.

74 changes: 0 additions & 74 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

85 changes: 85 additions & 0 deletions .github/workflows/matrix-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: "Matrix-Test"

on:
push:
branches: [master, main]
pull_request:
branches: [master, main]

jobs:
ix-build:
name: "${{ matrix.os }} ix-build"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest] # , macos-latest]

steps:
- uses: actions/checkout@v3

- name: 'Determine number of cores to build on (Linux)'
if: runner.os == 'Linux'
run: echo NPROC="$(nproc)" >> $GITHUB_ENV

- name: 'Determine number of cores to build on (macOS)'
if: runner.os == 'macOS'
run: echo NPROC="$(sysctl -n hw.logicalcpu)" >> $GITHUB_ENV

- name: 'Check shell environment'
run: |
echo "NPROC=$NPROC"
echo "SHELL=$SHELL"
echo "BASH_VERSION=$BASH_VERSION"
$SHELL --version

msys2-build:
needs: ix-build

name: '${{ matrix.os }} ${{ matrix.sys }} msys2-build'
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [windows-latest]
sys: [mingw32, mingw64, ucrt64, clang64]
include:
- sys: mingw32
env: i686
- sys: mingw64
env: x86_64
- sys: ucrt64
env: ucrt-x86_64
- sys: clang64
env: clang-x86_64

defaults:
run:
shell: 'msys2 {0}'

steps:
- name: 'git config core.autocrlf (Windows)'
run: git config --global core.autocrlf input
shell: bash

- uses: actions/checkout@v3

- name: 'Set MINGW_ARCH (Windows)'
shell: bash
run: echo MINGW_ARCH="${{ matrix.sys }}" >> $GITHUB_ENV

- name: 'Set up MSYS2 and Install Software'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}

- name: 'Determine number of cores to build on (Windows)'
run: echo NPROC="${NUMBER_OF_PROCESSORS-unknown}" >> $GITHUB_ENV

- name: 'Check shell environment'
run: |
echo "NPROC=$NPROC"
echo "SHELL=$SHELL"
echo "BASH_VERSION=$BASH_VERSION"
$SHELL --version