From 52f706c4cc2efba63c498546cc598857170b2974 Mon Sep 17 00:00:00 2001 From: Ting-Hsuan Huang <72808219+fffelix-huang@users.noreply.github.com> Date: Sat, 26 Oct 2024 04:11:47 +0800 Subject: [PATCH] Fix workflow for perft test (#26) --- .github/workflows/perft-test.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/perft-test.yml b/.github/workflows/perft-test.yml index 26bad81..094b74a 100644 --- a/.github/workflows/perft-test.yml +++ b/.github/workflows/perft-test.yml @@ -1,28 +1,39 @@ name: Run perft tests + on: - workflow_call: + push: + branches: + - master + pull_request: + branches: + - master jobs: - build-and-test: + perft-test: runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-latest] steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v2 - name: Install Dependencies run: | - sudo apt-get update || brew update - sudo apt-get install -y build-essential || brew install make + if [[ "$RUNNER_OS" == "Linux" ]]; then + sudo apt-get update + sudo apt-get install -y build-essential + elif [[ "$RUNNER_OS" == "macOS" ]]; then + brew update + brew install make + fi - name: Build Sonic - working-directory: Sonic/src + working-directory: src run: make - name: Run perft tests - working-directory: Sonic/src + working-directory: src run: | echo -e "perft\nquit" | ./sonic