lapce/.github/workflows/ci.yml

103 lines
2.5 KiB
YAML
Raw Normal View History

2022-06-16 14:24:07 +00:00
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
name: CI
jobs:
build:
name: Rust (${{ matrix.toolchain }}) on ${{ matrix.os }}
if: github.event.push || github.event.pull_request.draft == false
needs: [fmt, clippy]
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
toolchain: [ stable ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install dependencies on Ubuntu
if: startsWith(matrix.os, 'ubuntu')
2022-05-18 20:38:56 +00:00
run: sudo apt-get update && sudo apt-get install cmake pkg-config libgtk-3-dev
- name: Install latest toolchain
2022-06-20 08:06:16 +00:00
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
2022-06-16 14:24:07 +00:00
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v1
2022-06-19 14:21:11 +00:00
2022-06-20 00:45:09 +00:00
- name: Build
uses: actions-rs/cargo@v1
with:
2022-04-03 19:44:31 +00:00
command: build
2022-06-15 21:17:37 +00:00
- name: Run tests
uses: actions-rs/cargo@v1
2022-04-03 19:44:31 +00:00
with:
command: test
args: --workspace
2022-06-15 21:21:41 +00:00
fmt:
name: Rustfmt
runs-on: ubuntu-latest
2022-06-15 21:21:41 +00:00
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install latest toolchain with rustfmt
uses: actions-rs/toolchain@v1
2022-06-15 21:21:41 +00:00
with:
profile: minimal
toolchain: stable
2022-06-15 21:21:41 +00:00
override: true
components: rustfmt
- name: Run rustfmt
uses: actions-rs/cargo@v1
2022-06-15 21:21:41 +00:00
with:
command: fmt
args: --all -- --check
2022-06-15 21:17:37 +00:00
2022-06-15 21:21:41 +00:00
clippy:
name: Clippy (${{ matrix.toolchain }}) on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
toolchain: [ stable ]
runs-on: ${{ matrix.os }}
2022-06-15 21:21:41 +00:00
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install latest toolchain with clippy
uses: actions-rs/toolchain@v1
2022-06-15 21:21:41 +00:00
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
2022-06-15 21:21:41 +00:00
override: true
components: clippy
- name: Install dependencies on Ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get update && sudo apt-get install cmake pkg-config libgtk-3-dev
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v1
- name: Run clippy
uses: actions-rs/cargo@v1
2022-06-15 21:17:37 +00:00
with:
command: clippy
args: -- -D warnings