77 lines
2.1 KiB
YAML
77 lines
2.1 KiB
YAML
name: YYCC Linux Build
|
|
|
|
on: [workflow_dispatch]
|
|
|
|
jobs:
|
|
linux-build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
- name: Install Dependencies
|
|
shell: bash
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y build-essential cmake git
|
|
- name: Fetch Google Test
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: 'google/googletest'
|
|
ref: 'v1.17.0'
|
|
path: 'extern/googletest'
|
|
- name: Build Google Test
|
|
shell: bash
|
|
run: |
|
|
# Build Google Test
|
|
cd extern/googletest
|
|
mkdir build install
|
|
cd build
|
|
cmake -DCMAKE_CXX_STANDARD=23 -Dgtest_force_shared_crt=ON -DCMAKE_BUILD_TYPE=Release ..
|
|
cmake --build .
|
|
cmake --install . --prefix=../install
|
|
cd ..
|
|
cd install
|
|
echo "GTest_ROOT=$(pwd)" >> "$GITHUB_ENV"
|
|
cd ../..
|
|
- name: Fetch Google Benchmark
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: 'google/benchmark'
|
|
ref: 'v1.9.4'
|
|
path: 'extern/benchmark'
|
|
- name: Build Google Benchmark
|
|
shell: bash
|
|
run: |
|
|
# Build Google Benchmark
|
|
cd extern/benchmark
|
|
# Create symlink to googletest as required by benchmark
|
|
ln -s ../googletest googletest
|
|
mkdir build install
|
|
cd build
|
|
cmake -DCMAKE_CXX_STANDARD=23 -DBENCHMARK_ENABLE_TESTING=OFF -DCMAKE_BUILD_TYPE=Release ..
|
|
cmake --build .
|
|
cmake --install . --prefix=../install
|
|
cd ..
|
|
cd install
|
|
echo "benchmark_ROOT=$(pwd)" >> "$GITHUB_ENV"
|
|
cd ../..
|
|
- name: Build YYCC
|
|
shell: bash
|
|
run: |
|
|
chmod +x ./.github/linux_build.sh
|
|
./.github/linux_build.sh
|
|
- name: Run YYCC Test
|
|
shell: bash
|
|
run: |
|
|
./bin/install/bin/YYCCTest
|
|
- name: Run YYCC Benchmark
|
|
shell: bash
|
|
run: |
|
|
./bin/install/bin/YYCCBenchmark
|
|
- name: Upload Built Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: YYCC-linux-build
|
|
path: bin/install/*
|
|
retention-days: 30 |