aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/build.yml
blob: 700b49db73fcc8b0804a49282bccca68c1439bf7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Build

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  static-analysis:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Install cargo components
        run: |
          rustup component add rustfmt
          rustup component add clippy
      - name: Rust Format
        run: cargo fmt --all -- --check
      - uses: actions-rs/clippy-check@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          args: --all-features
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Rust Cache
        uses: Swatinem/rust-cache@v1.2.0
      - name: Build
        uses: actions-rs/cargo@v1
        with:
          command: build
          args: --all-targets
      - name: Run tests
        uses: actions-rs/cargo@v1
        env:
          NOTION_API_TOKEN: ${{ secrets.NOTION_API_TOKEN }}
        with:
          command: test
          args: --all-features
      - name: Docs
        uses: actions-rs/cargo@v1
        env:
          NOTION_API_TOKEN: ${{ secrets.NOTION_API_TOKEN }}
        with:
          command: doc