ext-php-rs/.github/workflows/build.yml
David e1ca2129fe
Add github actions for building and linting (#12)
* Added github build workflow

* Added lint workflow

* Fixed clippy errors

* Fixed clippy warnings

* Allow warnings on generated code

* Final clippy fix... hopefully
2021-03-11 13:41:05 +13:00

59 lines
1.3 KiB
YAML

name: Build and Lint
on:
- push
- pull_request
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
rust-toolchain:
- stable
- nightly
php:
- '8.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: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
lint:
name: Lint
runs-on: ubuntu-latest
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: Run rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings