Skip to content

Bump actions/cache from 3 to 4 #85

Bump actions/cache from 3 to 4

Bump actions/cache from 3 to 4 #85

Workflow file for this run

name: Test
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
check-changes:
name: Check whether tests need to be run based on diff
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: antrea-io/has-changes@v2
id: check_diff
with:
paths-ignore: docs/* *.md bazel/*
outputs:
has_changes: ${{ steps.check_diff.outputs.has_changes }}
test:
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }}
runs-on: [ubuntu-latest]
strategy:
matrix:
include:
- cxx: g++
cc: gcc
- cxx: clang++-8
cc: clang-8
- cxx: clang++-10
cc: clang-10
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Build test Docker image
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
docker build -t pi --build-arg IMAGE_TYPE=test --build-arg CC=$CC --build-arg CXX=$CXX -f Dockerfile.bmv2 .
- name: Run unit tests
run: |
docker run -w /PI pi bash -c \
'apt-get update && apt-get install -y python3-pip && \
python3 -m pip install ptf scapy grpcio googleapis-common-protos protobuf==3.20 && \
python3 ./proto/ptf/base_test.py'
- name: Run tests
run: |
docker run -w /PI pi bash -c \
'make check -j2 || (find . -name "test-suite.log" | xargs cat)'
- name: Check style
run: |
docker run -w /PI pi ./tools/check_style.sh