summaryrefslogtreecommitdiff
path: root/.github/workflows/ports_arch_check.yml
blob: 4a99c032df1442ed517ec995c0c7236549793c20 (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
# This is a basic workflow to help you get started with Actions

name: ports_arch_check

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
  pull_request:
    branches: [ master ]
    paths:
      - ".github/workflows/ports_arch_check.yml"
      - 'common/**'
      - 'common_modules/**'
      - 'common_smp/**'
      - 'ports/**'
      - 'ports_modules/**'
      - 'ports_smp/**'
      - 'ports_arch/**'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # Check ports for cortex-m
  cortex-m:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
    # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
    - name: Checkout sources recursively
      uses: actions/checkout@v2
      with:
        token: ${{ secrets.REPO_SCOPED_TOKEN }}
        submodules: true

    # Copy ports arch
    - name: Copy ports arch
      run: |
        scripts/copy_armv7_m.sh && scripts/copy_armv8_m.sh && scripts/copy_module_armv7_m.sh
        if [[ -n $(git status --porcelain -uno) ]]; then
          echo "Ports for ARM architecture is not updated"
          git status
          exit 1
        fi

  cortex-a:
    # Check ports for cortex-a
    runs-on: windows-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
    # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
    - name: Checkout sources recursively
      uses: actions/checkout@v2
      with:
        token: ${{ secrets.REPO_SCOPED_TOKEN }}
        submodules: true

    # Copy ports arch
    - name: Copy ports arch
      run: |
        cd ports_arch/ARMv7-A
        pwsh -Command ./update.ps1 -PortSets tx -CopyCommonFiles -CopyPortFiles -CopyExample -PatchFiles
        cd ../../ports_arch/ARMv8-A
        pwsh -Command ./update.ps1 -PortSets tx,tx_smp -CopyCommonFiles -CopyPortFiles -CopyExample -PatchFiles
        if ((git status --porcelain -uno) -ne $null) {
          Write-Host "Ports for ARM architecture is not updated"
          git status
          Exit 1
        }