• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: Continuous integration
2
3on:
4  push:
5    branches:
6      - master
7
8  pull_request:
9    branches:
10      - master
11
12jobs:
13  check:
14    runs-on: ubuntu-latest
15    strategy:
16      matrix:
17        rust: ["1.40.0", "stable", "beta", "nightly"]
18    name: Check (${{ matrix.rust }})
19    steps:
20      - uses: actions/checkout@v2
21      - name: Install minimal ${{ matrix.rust }}
22        uses: actions-rs/toolchain@v1
23        with:
24          profile: minimal
25          toolchain: ${{ matrix.rust }}
26          override: true
27      # Check each crate individually to work around rust-lang/cargo#4942
28      - name: Run cargo test for codespan-reporting
29        uses: actions-rs/cargo@v1
30        with:
31          command: check
32          args: --manifest-path "codespan-reporting/Cargo.toml" --features "serialization"
33      - name: Run cargo test for codespan
34        uses: actions-rs/cargo@v1
35        with:
36          command: check
37          args: --manifest-path "codespan/Cargo.toml" --features "serialization"
38      - name: Run cargo test for codespan-lsp
39        uses: actions-rs/cargo@v1
40        with:
41          command: check
42          args: --manifest-path "codespan-lsp/Cargo.toml"
43      - name: Switch to minimal lsp-types version for codespan-lsp
44        uses: actions-rs/cargo@v1
45        with:
46          command: update
47          # NOTE: Keep up to date with the minimum version of `lsp-types`
48          # specified in `codespan-lsp/Cargo.toml`
49          args: --precise lsp-types:0.70
50      - name: Run cargo test for codespan-lsp
51        uses: actions-rs/cargo@v1
52        with:
53          command: check
54          args: --manifest-path "codespan-lsp/Cargo.toml"
55
56  test:
57    runs-on: ubuntu-latest
58    strategy:
59      matrix:
60        rust: ["1.40.0", "stable", "beta", "nightly"]
61    name: Test Suite (${{ matrix.rust }})
62    steps:
63      - uses: actions/checkout@v2
64      - name: Install minimal ${{ matrix.rust }}
65        uses: actions-rs/toolchain@v1
66        with:
67          profile: minimal
68          toolchain: ${{ matrix.rust }}
69          override: true
70      # Test each crate individually to work around rust-lang/cargo#4942
71      - name: Run cargo test for codespan-reporting
72        uses: actions-rs/cargo@v1
73        with:
74          command: test
75          args: --manifest-path "codespan-reporting/Cargo.toml" --features "serialization"
76      - name: Run cargo test for codespan
77        uses: actions-rs/cargo@v1
78        with:
79          command: test
80          args: --manifest-path "codespan/Cargo.toml" --features "serialization"
81      - name: Switch to minimal lsp-types version for codespan-lsp
82        uses: actions-rs/cargo@v1
83        with:
84          command: update
85          # NOTE: Keep up to date with the minimum version of `lsp-types`
86          # specified in `codespan-lsp/Cargo.toml`
87          args: --precise lsp-types:0.70
88      - name: Run cargo test for codespan-lsp
89        uses: actions-rs/cargo@v1
90        with:
91          command: test
92          args: --manifest-path "codespan-lsp/Cargo.toml"
93
94  fmt:
95    runs-on: ubuntu-latest
96    strategy:
97      matrix:
98        rust: ["1.40.0", "stable", "beta", "nightly"]
99    name: Rustfmt (${{ matrix.rust }})
100    steps:
101      - uses: actions/checkout@v2
102      - name: Install minimal ${{ matrix.rust }} with rustfmt
103        uses: actions-rs/toolchain@v1
104        with:
105          profile: minimal
106          toolchain: ${{ matrix.rust }}
107          override: true
108          components: rustfmt
109      - name: Run cargo fmt
110        uses: actions-rs/cargo@v1
111        with:
112          command: fmt
113          args: --all -- --check
114