Use github actions for ci

This commit is contained in:
Richard Hozák
2020-03-15 02:28:26 +01:00
parent 363dd8eb29
commit 9e7a3e9cd5

113
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,113 @@
on:
push:
branches:
- master
pull_request:
jobs:
rustfmt:
runs-on: ubuntu-latest
name: rustfmt
steps:
- uses: actions/checkout@v1
- name: install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: rustfmt
override: true
- name: install rustfmt
run: rustup component add rustfmt
- name: cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
test-stable:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macOS-latest, windows-2019, ubuntu-latest]
name: cargo test stable
steps:
- uses: actions/checkout@v1
- name: install libgtk-dev libwebkit2gtk-4.0
run: |
sudo apt update
sudo apt install libwebkit2gtk-4.0-dev
if: contains(matrix.os, 'ubuntu')
- name: install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: cargo test --all
uses: actions-rs/cargo@v1
with:
command: test
args: --all
test-nightly:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macOS-latest, windows-2019, ubuntu-latest]
name: cargo test nightly
steps:
- uses: actions/checkout@v1
- name: install libgtk-dev libwebkit2gtk-4.0
run: |
sudo apt update
sudo apt install libwebkit2gtk-4.0-dev
if: contains(matrix.os, 'ubuntu')
- name: install nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
- name: cargo test --all
uses: actions-rs/cargo@v1
with:
command: test
args: --all
check-docs:
name: Docs
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macOS-latest, windows-2019, ubuntu-latest]
steps:
- uses: actions/checkout@v1
- name: install libgtk-dev libwebkit2gtk-4.0
run: |
sudo apt update
sudo apt install libwebkit2gtk-4.0-dev
if: contains(matrix.os, 'ubuntu')
- name: install nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
- name: check docs
uses: actions-rs/cargo@v1
with:
command: doc
args: --document-private-items