Upstream fixes. (#112) #288
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "test-flay-m1" | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
# Cancel any preceding run on the pull request. | |
concurrency: | |
group: test-flay-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
jobs: | |
# Build and test Flay on M1 Mac. | |
build-and-test-flay-on-mac-m1: | |
name: Build and test Flay on Mac(M1) | |
runs-on: macos-14 | |
env: | |
CTEST_PARALLEL_LEVEL: 4 | |
CMAKE_UNITY_BUILD: ON | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: ccache | |
uses: hendrikmuhs/ccache-action@v1 | |
with: | |
key: test-${{ runner.os }} | |
max-size: 1000M | |
- name: Pull P4C and link Flay. | |
run: | | |
git clone --recurse-submodules -b fruffy/flay -j2 https://github.com/fruffy/p4c/ $GITHUB_WORKSPACE/../p4c | |
ln -sf $GITHUB_WORKSPACE $GITHUB_WORKSPACE/../p4c/backends/p4tools/modules/ | |
ln -sf $GITHUB_WORKSPACE/../p4c/tools/install_mac_deps.sh $GITHUB_WORKSPACE/install_mac_deps.sh | |
- name: Get brew cache dir | |
id: brew-cache | |
run: | | |
echo "dir=$(brew --prefix)" >> $GITHUB_OUTPUT | |
- name: Cache Homebrew Packages | |
id: cache-homebrew-packages | |
uses: actions/cache@v4 | |
env: | |
cache-name: homebrew-packages | |
with: | |
path: ${{ steps.brew-cache.outputs.dir }} | |
key: ${{ runner.os }}-m1-${{ hashFiles('install_mac_deps.sh') }} | |
- name: Install dependencies (MacOS) | |
run: | | |
# TODO: We shouldn't need to do this. | |
python3 -m pip config set global.break-system-packages true | |
tools/install_mac_deps.sh | |
working-directory: ../p4c | |
- name: Build (MacOS) | |
run: | | |
source ~/.bash_profile | |
./bootstrap.sh -DENABLE_GC=ON -DCMAKE_BUILD_TYPE=RELEASE \ | |
-DCMAKE_UNITY_BUILD=ON -DENABLE_TEST_TOOLS=ON | |
make -C build -j$((`nproc`+1)) | |
working-directory: ../p4c | |
- name: Run tests (MacOS) | |
run: | | |
source ~/.bash_profile | |
ctest -R flay- --output-on-failure --schedule-random | |
working-directory: ../p4c/build |