summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/openwrt-ci-pull-request.yml
blob: e8c29c13da4bcc674b2f2abab74a854834d95c14 (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
87
88
89
name: OpenWrt CI pull request testing

on:
  pull_request:
    types: [opened, reopened, synchronize]

env:
  CI_ENABLE_UNIT_TESTING: 1
  CI_TARGET_BUILD_DEPENDS: libnl-tiny ubus uci

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
  native_testing:
    name: Various native checks
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - uses: ynezz/gh-actions-openwrt-ci-native@v0.0.2
        env:
          CI_GCC_VERSION_LIST:
          CI_CLANG_VERSION_LIST: 11

      - name: Upload build artifacts
        uses: actions/upload-artifact@v3
        if: failure()
        with:
          name: native-build-artifacts
          if-no-files-found: ignore
          path: |
            build/scan
            tests/cram/**/*.t.err

  sdk_build:
    name: Build with OpenWrt ${{ matrix.arch }} SDK
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        include:
          - arch: mips_24kc
            target: ath79-generic

          - arch: arm_cortex-a9_neon
            target: imx-cortexa9

          - arch: mipsel_24kc
            target: malta-le

          - arch: aarch64_cortex-a53
            target: mediatek-mt7622

    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Determine branch name
        run: |
          BRANCH="${GITHUB_BASE_REF#refs/heads/}"
          echo "Building for $BRANCH"
          echo "BRANCH=$BRANCH" >> $GITHUB_ENV

      - name: Build with OpenWrt ${{ matrix.arch }} SDK
        uses: openwrt/gh-action-sdk@v5
        env:
          ARCH: ${{ matrix.arch }}
          FEEDNAME: ucode_ci
          PACKAGES: ucode

      - name: Move created packages to project dir
        run: cp bin/packages/${{ matrix.arch }}/ucode_ci/*.ipk . || true

      - name: Store packages
        uses: actions/upload-artifact@v3
        with:
          name: ${{ matrix.arch }}-packages
          path: "*.ipk"

      - name: Store logs
        uses: actions/upload-artifact@v3
        with:
          name: ${{ matrix.arch }}-logs
          path: logs/