aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/on-target.yml
blob: cc0c2ee9e476cce5c31d6db18e6e6c60aafde876 (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
87
on:
  push:
    branches-ignore:
      - "gh-readonly-queue/**"
  pull_request:
  merge_group:
  # allows manual triggering
  workflow_dispatch:

name: cortex-m on-target tests

jobs:

  hil-qemu:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
          target: thumbv7m-none-eabi
      - name: Build testsuite
        env:
          RUSTFLAGS: -C link-arg=-Tlink.x -D warnings
        run: cargo build -p testsuite --target thumbv7m-none-eabi --features semihosting,cortex-m/critical-section-single-core
      - name: Install QEMU
        run: sudo apt-get update && sudo apt-get install qemu qemu-system-arm
      - name: Run testsuite
        run: |
          qemu-system-arm \
            -cpu cortex-m3 \
            -machine lm3s6965evb \
            -nographic \
            -semihosting-config enable=on,target=native \
            -kernel target/thumbv7m-none-eabi/debug/testsuite

  hil-compile-rtt:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
          target: thumbv6m-none-eabi
      - name: Modify linkerfile
        run: |
          sed -i 's/FLASH : ORIGIN = 0x00000000, LENGTH = 256K/FLASH : ORIGIN = 0x8000000, LENGTH = 128K/g' memory.x
          sed -i 's/RAM : ORIGIN = 0x20000000, LENGTH = 64K/RAM : ORIGIN = 0x20000000, LENGTH = 16K/g' memory.x
      - name: Build testsuite
        env:
          RUSTFLAGS: -C link-arg=-Tlink.x -D warnings
        run: cargo build -p testsuite --target thumbv6m-none-eabi --features rtt,cortex-m/critical-section-single-core
      - name: Upload testsuite binaries
        uses: actions/upload-artifact@v3
        with:
          name: testsuite-bin
          if-no-files-found: error
          retention-days: 1
          path: target/thumbv6m-none-eabi/debug/testsuite

  hil-stm32:
    runs-on: self-hosted
    needs:
      - hil-compile-rtt
    steps:
      - uses: actions/checkout@v4
      - name: Display probe-run version
        run: probe-run --version
      - name: List probes
        run: probe-run --list-probes
      # TODO: replace with actions/download-artifact when they update to node20
      # https://github.com/actions/download-artifact/issues/230
      - uses: newAM/download-artifact@4202241ccada6f83f838525a8af979a4ec900a49
        with:
          name: testsuite-bin
          path: testsuite-bin
      - name: Run on-target tests
        timeout-minutes: 5
        run: |
          probe-run \
          --chip STM32F070RBTx \
          --connect-under-reset \
          testsuite-bin/testsuite