summaryrefslogtreecommitdiff
path: root/.github/workflows/rust.yml
blob: 515dc50e129d6766226ed41f429cfb4b2ebbd203 (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
name: Rustlings Tests

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

env:
  CARGO_TERM_COLOR: always

jobs:
  fmt:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt
      - uses: DavidAnson/markdownlint-cli2-action@v9
        with:
          globs: "exercises/**/*.md"
      - name: Run cargo fmt
        run: |
          cargo fmt --all -- --check
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macOS-latest]
    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@stable
      - uses: swatinem/rust-cache@v2
      - name: Run cargo test
        run: |
          cargo test