mirror of
https://github.com/danog/ext-php-rs.git
synced 2024-12-11 16:49:53 +01:00
0db6888c46
* Added support for PHP ZTS * Added GitHub action for ZTS Runs seperate from the other tests, as the setup-php action does not support ZTS, therefore we run the tests in a Docker container. * Source Rust env file before building * No `source` command on docker * Another attempt at fixing Rust in Docker
91 lines
2.2 KiB
YAML
91 lines
2.2 KiB
YAML
name: Build and Lint
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- macos-latest
|
|
rust-toolchain:
|
|
- stable
|
|
- nightly
|
|
php:
|
|
- '8.0'
|
|
llvm:
|
|
- '11.0'
|
|
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 }}
|
|
- name: Setup LLVM & Clang
|
|
uses: KyleMayes/install-llvm-action@v1
|
|
with:
|
|
version: ${{ matrix.llvm }}
|
|
directory: ${{ runner.temp }}/llvm-${{ matrix.llvm }}
|
|
- name: Build
|
|
uses: actions-rs/cargo@v1
|
|
env:
|
|
LIBCLANG_PATH: ${{ runner.temp }}/llvm-${{ matrix.llvm }}/lib
|
|
with:
|
|
command: build
|
|
args: --release
|
|
build-zts:
|
|
name: Build with ZTS
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
- name: Build
|
|
uses: ./.github/actions/zts
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
llvm:
|
|
- '11.0'
|
|
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
|
|
- name: Setup LLVM & Clang
|
|
uses: KyleMayes/install-llvm-action@v1
|
|
with:
|
|
version: ${{ matrix.llvm }}
|
|
directory: ${{ runner.temp }}/llvm-${{ matrix.llvm }}
|
|
- name: Run rustfmt
|
|
uses: actions-rs/cargo@v1
|
|
env:
|
|
LIBCLANG_PATH: ${{ runner.temp }}/llvm-${{ matrix.llvm }}/lib
|
|
with:
|
|
command: fmt
|
|
args: --all -- --check
|
|
- name: Run clippy
|
|
uses: actions-rs/cargo@v1
|
|
env:
|
|
LIBCLANG_PATH: ${{ runner.temp }}/llvm-${{ matrix.llvm }}/lib
|
|
with:
|
|
command: clippy
|
|
args: -- -D warnings
|