aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/main.yml
blob: 17f92a976b8c5ceeecd918598ec2b11762c29f08 (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: CI

on:
  push:
    branches: ['master', 'auto']
  pull_request:

jobs:
  Test:
    strategy:
      matrix:
        os: [ubuntu-latest]
        rust: [1.36.0, stable, beta, nightly]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.rust }}
          override: true
          profile: minimal
      - uses: actions-rs/cargo@v1
        with:
          command: build
          args: --all-targets
      - uses: actions-rs/cargo@v1
        with:
          command: test
      - uses: actions-rs/cargo@v1
        with:
          command: test
          args: --features "serde"
      - uses: actions-rs/cargo@v1
        with:
          command: test
          args: --no-default-features
      - uses: actions-rs/cargo@v1
        with:
          command: test
          args: --no-default-features --features=hardcoded-data
  Fmt:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          override: true
          components: rustfmt
      - uses: actions-rs/cargo@v1
        with:
          command: fmt
          args: --check

  build_result:
    name: homu build finished
    runs-on: ubuntu-latest
    needs:
      - "Test"
      - "Fmt"
    steps:
      - name: Mark the job as successful
        run: exit 0
        if: success()
      - name: Mark the job as unsuccessful
        run: exit 1
        if: "!success()"