Commit 0244bceb
0244bcebe851Merged
Yasuhiro Matsumoto <[email protected]> · 7 months ago · 1 file · +1 added
Description
ci: add GitHub Actions workflow for build and test
Run the build and feature tests on Linux (gcc/clang), macOS (clang), and Windows (MinGW64/gcc) on every push and PR to master.
Details
- Commit
- 0244bcebe851
- Parent
- 43bb35fe5d04
.github/workflows/ci.ymladdedView file
1+
name: CI2+
3+
on:4+
push:5+
branches: [master]6+
pull_request:7+
branches: [master]8+
9+
jobs:10+
posix:11+
name: ${{ matrix.os }} / ${{ matrix.cc }}12+
runs-on: ${{ matrix.os }}13+
strategy:14+
fail-fast: false15+
matrix:16+
include:17+
- os: ubuntu-latest18+
cc: gcc19+
- os: ubuntu-latest20+
cc: clang21+
- os: macos-latest22+
cc: clang23+
env:24+
CC: ${{ matrix.cc }}25+
steps:26+
- uses: actions/checkout@v427+
28+
- name: Set up Ruby29+
uses: ruby/setup-ruby@v130+
with:31+
ruby-version: "3.3"32+
33+
- name: Install prism gem (codegen bootstrap step 2 needs it)34+
run: gem install prism -v 1.9.035+
36+
- name: Expose GNU coreutils on PATH (macOS)37+
if: runner.os == 'macOS'38+
run: echo "/opt/homebrew/opt/coreutils/libexec/gnubin" >> "$GITHUB_PATH"39+
40+
- name: Fetch libprism sources41+
run: make deps42+
43+
- name: Build (parse + regexp + bootstrap)44+
run: make -j$(getconf _NPROCESSORS_ONLN) all45+
46+
- name: Run tests47+
run: make test48+
49+
windows-mingw:50+
name: windows-mingw51+
runs-on: windows-latest52+
defaults:53+
run:54+
shell: msys2 {0}55+
env:56+
CC: gcc57+
steps:58+
- uses: actions/checkout@v459+
60+
- name: Set up MSYS2 (MINGW64)61+
uses: msys2/setup-msys2@v262+
with:63+
msystem: MINGW6464+
update: false65+
install: >-66+
base-devel67+
mingw-w64-x86_64-toolchain68+
mingw-w64-x86_64-ruby69+
make70+
diffutils71+
curl72+
tar73+
74+
- name: Show toolchain75+
run: |76+
uname -a77+
gcc --version78+
ruby --version79+
make --version | head -180+
81+
- name: Install prism gem (codegen bootstrap step 2 needs it)82+
run: gem install prism -v 1.9.083+
84+
- name: Fetch libprism sources85+
run: make deps86+
87+
- name: Build (parse + regexp + bootstrap)88+
run: make -j$(nproc) all89+
90+
- name: Run tests91+
run: make test