2021-03-11 01:41:05 +01:00
|
|
|
name: Build and Lint
|
|
|
|
on:
|
2021-04-24 03:29:53 +02:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
2021-03-11 01:41:05 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2021-08-21 15:33:22 +02:00
|
|
|
name: Build and Test
|
2021-03-11 01:41:05 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- ubuntu-latest
|
|
|
|
- macos-latest
|
|
|
|
rust-toolchain:
|
|
|
|
- stable
|
|
|
|
- nightly
|
|
|
|
php:
|
|
|
|
- '8.0'
|
2021-04-16 14:17:02 +02:00
|
|
|
llvm:
|
|
|
|
- '11.0'
|
2021-03-11 01:41:05 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php }}
|
|
|
|
- name: Setup Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.rust-toolchain }}
|
2021-04-16 14:17:02 +02:00
|
|
|
- name: Setup LLVM & Clang
|
|
|
|
uses: KyleMayes/install-llvm-action@v1
|
|
|
|
with:
|
2021-04-16 14:20:17 +02:00
|
|
|
version: ${{ matrix.llvm }}
|
|
|
|
directory: ${{ runner.temp }}/llvm-${{ matrix.llvm }}
|
2021-08-21 15:33:22 +02:00
|
|
|
- name: Install mdbook
|
|
|
|
uses: peaceiris/actions-mdbook@v1
|
|
|
|
with:
|
|
|
|
mdbook-version: latest
|
2021-03-11 01:41:05 +01:00
|
|
|
- name: Build
|
|
|
|
uses: actions-rs/cargo@v1
|
2021-04-16 14:05:17 +02:00
|
|
|
env:
|
2021-04-16 14:20:17 +02:00
|
|
|
LIBCLANG_PATH: ${{ runner.temp }}/llvm-${{ matrix.llvm }}/lib
|
2021-03-11 01:41:05 +01:00
|
|
|
with:
|
|
|
|
command: build
|
|
|
|
args: --release
|
2021-08-21 15:33:22 +02:00
|
|
|
- name: Test guide examples
|
|
|
|
run: |
|
|
|
|
mdbook test guide -L target/release/deps
|
|
|
|
- name: Test inline examples
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
env:
|
|
|
|
LIBCLANG_PATH: ${{ runner.temp }}/llvm-${{ matrix.llvm }}/lib
|
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
args: --release
|
2021-05-19 10:45:39 +02:00
|
|
|
build-zts:
|
|
|
|
name: Build with ZTS
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Build
|
|
|
|
uses: ./.github/actions/zts
|
2021-03-11 01:41:05 +01:00
|
|
|
lint:
|
|
|
|
name: Lint
|
|
|
|
runs-on: ubuntu-latest
|
2021-04-16 14:17:02 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
llvm:
|
|
|
|
- '11.0'
|
2021-03-11 01:41:05 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
2021-04-16 14:17:02 +02:00
|
|
|
- name: Setup LLVM & Clang
|
|
|
|
uses: KyleMayes/install-llvm-action@v1
|
|
|
|
with:
|
2021-04-16 14:25:07 +02:00
|
|
|
version: ${{ matrix.llvm }}
|
2021-04-16 14:20:17 +02:00
|
|
|
directory: ${{ runner.temp }}/llvm-${{ matrix.llvm }}
|
2021-03-11 01:41:05 +01:00
|
|
|
- name: Run rustfmt
|
|
|
|
uses: actions-rs/cargo@v1
|
2021-04-16 14:17:02 +02:00
|
|
|
env:
|
2021-04-16 14:20:17 +02:00
|
|
|
LIBCLANG_PATH: ${{ runner.temp }}/llvm-${{ matrix.llvm }}/lib
|
2021-03-11 01:41:05 +01:00
|
|
|
with:
|
|
|
|
command: fmt
|
|
|
|
args: --all -- --check
|
|
|
|
- name: Run clippy
|
|
|
|
uses: actions-rs/cargo@v1
|
2021-04-16 14:17:02 +02:00
|
|
|
env:
|
2021-04-16 14:25:07 +02:00
|
|
|
LIBCLANG_PATH: ${{ runner.temp }}/llvm-${{ matrix.llvm }}/lib
|
2021-03-11 01:41:05 +01:00
|
|
|
with:
|
|
|
|
command: clippy
|
|
|
|
args: -- -D warnings
|