name: BPF checks

on:
  pull_request: {}
  push:
    branches:
      - master

jobs:
  checkpatch:
    name: checkpatch
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Run checkpatch.pl
        uses: docker://cilium/cilium-checkpatch:5b099019bf0db775b33b3f32cd5ecea55dd15f21
  coccicheck:
    name: coccicheck
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: docker://cilium/coccicheck:1.0
        with:
          entrypoint: ./contrib/coccinelle/check-cocci.sh

name: BPF checks

on:
  pull_request: {}
  push:
    branches:
      - master

jobs:
  checkpatch:
    name: checkpatch
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Run checkpatch.pl
        uses: docker://cilium/cilium-checkpatch:5b099019bf0db775b33b3f32cd5ecea55dd15f21
  coccicheck:
    name: coccicheck
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: docker://cilium/coccicheck:1.0
        with:
          entrypoint: ./contrib/coccinelle/check-cocci.sh
  build_all:
    name: build datapath
    runs-on: ubuntu-latest
    steps:
      - name: Cache LLVM and Clang
        id: cache-llvm
        uses: actions/cache@v2
        with:
          path: $HOME/.clang
          key: llvm-10.0
      - name: Install LLVM and Clang
        uses: KyleMayes/install-llvm-action@v1
        with:
          version: "10.0"
          directory: $HOME/.clang
          cached: ${{ steps.cache-llvm.outputs.cache-hit }}
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Build all BPF datapath permutations
        env:
          V: 0
        run: |
          make --quiet -C bpf build_all || (echo "Run 'make -C bpf build_all' locally to investigate build breakages"; exit 1)

Add action to build all BPF permutations
ci(gha): Add action to build all BPF permutations

Use "make -C bpf build_all" to validate the buildability of the datapath
in a variety of permutations of input configurations.

Signed-off-by: Joe Stringer <16a9a54ddf4259952e3c118c763138e83693d7fd@cilium.io>
