From a62f783efb42af096d271667fb877544b0bbd11b Mon Sep 17 00:00:00 2001 From: Dan Zheng Date: Thu, 22 Feb 2024 10:08:06 -0800 Subject: [PATCH] Set up GitHub Actions CI. PiperOrigin-RevId: 609411485 --- .github/workflows/build.yml | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..2813be53 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,45 @@ +name: Build + +# Trigger on push or via manual dispath. +on: [push, workflow_dispatch] + +jobs: + build: + runs-on: ${{matrix.os}} + name: ${{ matrix.os }} ${{ matrix.type }} + timeout-minutes: 30 + + strategy: + fail-fast: false + matrix: + type: ['Release'] + os: ['ubuntu-latest'] + + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + + steps: + - uses: actions/checkout@v4 + + # Set up ccache + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + + # Install CMake + - uses: lukka/get-cmake@latest + + # Build via CMake + # Reference: https://github.com/lukka/run-cmake/blob/v3/action.yml + - name: Build via cmake + uses: lukka/run-cmake@v3 + with: + cmakeListsOrSettingsJson: CMakeListsTxtAdvanced + cmakeAppendedArgs: > + -D CMAKE_C_COMPILER_LAUNCHER=ccache + -D CMAKE_CXX_COMPILER_LAUNCHER=ccache + buildWithCMake: true + # Explicitly list build targets here. + # Building "all" includes test executables and takes much longer. + buildWithCMakeArgs: "-- gemma" + buildDirectory: '${{ github.workspace }}/build' \ No newline at end of file