summaryrefslogtreecommitdiffstats
path: root/third_party/rust/minidump-writer/.github/workflows/ci.yml
blob: b007bd2370e23a8c2d4cdc8fedf6e2d33089ca7c (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Continuous Integration

on:
  push:
    branches:
      - main
      - github-actions
  pull_request:

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

jobs:
  lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt,clippy
      - name: rustfmt
        run: cargo fmt --all -- --check
      - name: clippy
        run: cargo clippy --all-features --all-targets -- -D warnings

  test:
    name: Test
    runs-on: ${{ matrix.job.os }}
    strategy:
      matrix:
        job:
          - { os: ubuntu-20.04 , target: x86_64-unknown-linux-gnu }
          - { os: ubuntu-20.04,  target: x86_64-unknown-linux-musl }
          - { os: windows-2022,  target: x86_64-pc-windows-msvc }
          - { os: macos-12,      target: x86_64-apple-darwin }
          # TODO: Add macos aarch64 here once it becomes available as a runner
    steps:
      - uses: actions/checkout@v3
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          target: ${{ matrix.job.target }}
      - name: Fetch
        run: cargo fetch --target ${{ matrix.job.target }}
      - name: Build
        run: cargo test --target ${{ matrix.job.target }} --no-run
      - name: Test
        run: cargo test --target ${{ matrix.job.target }}

  # This job builds non-tier1 targets that aren't already tested
  build_lower_tier:
    name: Build sources
    runs-on: ${{ matrix.job.os }}
    strategy:
      matrix:
        job:
          - { os: ubuntu-latest,  target: i686-unknown-linux-gnu,      use-cross: true }
         #- { os: ubuntu-latest,  target: i686-unknown-linux-musl,     use-cross: true }
          - { os: ubuntu-latest,  target: aarch64-unknown-linux-gnu,   use-cross: true }
          - { os: ubuntu-latest,  target: aarch64-unknown-linux-musl,  use-cross: true }
          - { os: ubuntu-latest,  target: aarch64-linux-android,       use-cross: true }
          - { os: ubuntu-latest,  target: arm-unknown-linux-gnueabi,   use-cross: true }
          - { os: ubuntu-latest,  target: arm-unknown-linux-musleabi,  use-cross: true }
          - { os: ubuntu-latest,  target: arm-linux-androideabi,       use-cross: true }
          - { os: ubuntu-latest,  target: arm-unknown-linux-gnueabihf, use-cross: true }
          # TODO: Remove this when aarch64 macs can be used as runners
          - { os: macos-latest,   target: aarch64-apple-darwin,        use-cross: false }
    steps:
      - uses: actions/checkout@v3
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          target: ${{ matrix.job.target }}
      #- name: Unit tests
      - name: Build
        uses: actions-rs/cargo@v1
        with:
          #command: test
          command: build
          use-cross: ${{ matrix.job.use-cross }}
          args: --target ${{ matrix.job.target }} --verbose --all-targets
          #args: --target ${{ matrix.job.target }} --verbose -- --nocapture