aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/rt-ci.yml
blob: d46e48a29d150f56d907bb88624297b52b4c2e05 (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
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
on:
  push:
    branches: [ staging, trying, master ]
  pull_request:

name: cortex-m-rt CI

jobs:
  rt-ci-linux:
    runs-on: ubuntu-20.04
    continue-on-error: ${{ matrix.experimental || false }}
    strategy:
      matrix:
        rust: [nightly, stable, 1.59.0]

        include:
          # Nightly is only for reference and allowed to fail
          - rust: nightly
            experimental: true
    defaults:
      run:
        working-directory: cortex-m-rt
    steps:
      - uses: actions/checkout@v3
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: ${{ matrix.rust }}
          override: true
      - name: Install all Rust targets for ${{ matrix.rust }}
        run: rustup target install --toolchain=${{ matrix.rust }} thumbv6m-none-eabi thumbv7m-none-eabi thumbv7em-none-eabi thumbv7em-none-eabihf thumbv8m.base-none-eabi thumbv8m.main-none-eabi thumbv8m.main-none-eabihf
      - name: Install qemu and gcc
        run: sudo apt-get update && sudo apt-get install qemu-system-arm gcc-arm-none-eabi
      - name: Run CI script for x86_64-unknown-linux-gnu under ${{ matrix.rust }}
        run: TARGET=x86_64-unknown-linux-gnu TRAVIS_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
      - name: Run CI script for thumbv6m-none-eabi under ${{ matrix.rust }}
        run: TARGET=thumbv6m-none-eabi TRAVIS_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
      - name: Run CI script for thumbv7m-none-eabi under ${{ matrix.rust }}
        run: TARGET=thumbv7m-none-eabi TRAVIS_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
      - name: Run CI script for thumbv7em-none-eabi under ${{ matrix.rust }}
        run: TARGET=thumbv7em-none-eabi TRAVIS_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
      - name: Run CI script for thumbv7em-none-eabihf under ${{ matrix.rust }}
        run: TARGET=thumbv7em-none-eabihf TRAVIS_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
      - name: Run CI script for thumbv8m.base-none-eabi under ${{ matrix.rust }}
        run: TARGET=thumbv8m.base-none-eabi TRAVIS_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
      - name: Run CI script for thumbv8m.main-none-eabi under ${{ matrix.rust }}
        run: TARGET=thumbv8m.main-none-eabi TRAVIS_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
      - name: Run CI script for thumbv8m.main-none-eabihf under ${{ matrix.rust }}
        run: TARGET=thumbv8m.main-none-eabihf TRAVIS_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh

  # On macOS and Windows, we at least make sure that all examples build and link.
  rt-ci-other-os:
    strategy:
      matrix:
        os:
          - macOS-latest
          - windows-latest
    runs-on: ${{ matrix.os }}
    defaults:
      run:
        working-directory: cortex-m-rt
    steps:
      - uses: actions/checkout@v3
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
      - name: Install all Rust targets
        run: rustup target install thumbv6m-none-eabi thumbv7m-none-eabi thumbv7em-none-eabi thumbv7em-none-eabihf thumbv8m.base-none-eabi thumbv8m.main-none-eabi thumbv8m.main-none-eabihf
      - name: Build examples for thumbv6m-none-eabi
        run: cargo build --target=thumbv6m-none-eabi --features cortex-m/critical-section-single-core --examples
      - name: Build examples for thumbv7m-none-eabi
        run: cargo build --target=thumbv7m-none-eabi --features cortex-m/critical-section-single-core --examples
      - name: Build examples for thumbv7em-none-eabi
        run: cargo build --target=thumbv7em-none-eabi --features cortex-m/critical-section-single-core --examples
      - name: Build examples for thumbv7em-none-eabihf
        run: cargo build --target=thumbv7em-none-eabihf --features cortex-m/critical-section-single-core --examples
      - name: Build examples for thumbv8m.base-none-eabi
        run: cargo build --target=thumbv8m.base-none-eabi --features cortex-m/critical-section-single-core --examples
      - name: Build examples for thumbv8m.main-none-eabi
        run: cargo build --target=thumbv8m.main-none-eabi --features cortex-m/critical-section-single-core --examples
      - name: Build examples for thumbv8m.main-none-eabihf
        run: cargo build --target=thumbv8m.main-none-eabihf --features cortex-m/critical-section-single-core --examples
      - name: Build crate for host OS
        run: cargo build