summaryrefslogtreecommitdiff
path: root/.github/workflows/build_aarch64.yml
blob: 8a91ee630e2e293fecd62711334f2770e6132240 (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
name: Build AArch64

on:
  workflow_dispatch:
  push:
    paths:
      - 'src/**'
      - 'examples/**'
      - 'lib/**'
      - 'hw/**'
      - '.github/workflows/build_aarch64.yml'
  pull_request:
    branches: [ master ]
    paths:
      - 'src/**'
      - 'examples/**'
      - 'lib/**'
      - 'hw/**'
      - '.github/workflows/build_aarch64.yml'

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

jobs:
  # ---------------------------------------
  # Build AARCH64 family
  # ---------------------------------------
  build-arm:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        family:
        # Alphabetical order
        - 'broadcom_64bit'
    steps:
    - name: Setup Python
      uses: actions/setup-python@v4
      with:
        python-version: '3.x'

    - name: Checkout TinyUSB
      uses: actions/checkout@v3

    - name: Checkout hathach/linkermap
      uses: actions/checkout@v3
      with:
         repository: hathach/linkermap
         path: linkermap

    - name: Set Toolchain URL
      run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz

    - name: Cache Toolchain
      uses: actions/cache@v3
      id: cache-toolchain
      with:
        path: ~/cache/
        key: ${{ runner.os }}-21-11-02-${{ env.TOOLCHAIN_URL }}

    - name: Install Toolchain
      if: steps.cache-toolchain.outputs.cache-hit != 'true'
      run: |
        mkdir -p ~/cache/toolchain
        wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz
        tar -C ~/cache/toolchain -xaf toolchain.tar.gz

    - name: Set Toolchain Path
      run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`

    - name: Get Dependencies
      run: python3 tools/get_deps.py ${{ matrix.family }}

    - name: Build
      run: python3 tools/build_make.py ${{ matrix.family }}

    - name: Linker Map
      run: |
        pip install linkermap/
        for ex in `ls -d examples/device/*/`; do \
          find ${ex} -name *.map -print -quit | \
          xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'; \
        done