Merge branch 'main' of github.com:hikoworks/hikolang #27
This file contains hidden or 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: "Linux" | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: false | |
jobs: | |
build-and-test: | |
name: x64-linux | |
runs-on: ubuntu-24.04 | |
env: | |
DEBUG_BUILD_DIR: ${{github.workspace}}/out/build/x64-linux/Debug | |
RELEASE_BUILD_DIR: ${{github.workspace}}/out/build/x64-linux/Release | |
INSTALL_DIR: ${{github.workspace}}/out/install | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install development environment | |
run: | | |
wget https://apt.llvm.org/llvm.sh | |
chmod 755 llvm.sh | |
echo "" | sudo ./llvm.sh 20 | |
sudo apt-get install -y perl autoconf-archive ninja-build cmake pkg-config clang-20 lldb-20 lld-20 clangd-20 | |
sudo ln -f /usr/bin/clang-20 /usr/bin/clang | |
sudo ln -f /usr/bin/clang++-20 /usr/bin/clang++ | |
- name: Get vcpkg commit id | |
working-directory: vcpkg | |
run: git rev-parse HEAD >commit.txt | |
- name: Install vcpkg | |
working-directory: vcpkg | |
run: ./bootstrap-vcpkg.sh | |
- name: Create vcpkg cache | |
working-directory: vcpkg | |
run: mkdir binary-sources | |
- name: Restore vcpkg binary-cache | |
id: restore-vcpkg-cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: vcpkg/binary-sources/**/*.zip | |
key: vcpkg-cache-x64-linux-${{hashFiles('vcpkg.json', 'vcpkg/commit.txt')}}-1 | |
- name: CMake - Configure | |
run: cmake --preset=x64-linux . | |
- name: Save vcpkg binary-cache | |
uses: actions/cache/save@v4 | |
id: save-vcpkg-cache | |
if: always() && steps.restore-vcpkg-cache.outputs.cache-hit != 'true' | |
with: | |
path: vcpkg/binary-sources/**/*.zip | |
key: ${{steps.restore-vcpkg-cache.outputs.cache-primary-key}} | |
- name: CMake - Build (Debug) | |
run: cmake --build --preset=x64-linux-dbg --parallel 1 . | |
- name: CMake - Build (Release) | |
run: cmake --build --preset=x64-linux-rel --parallel 1 . | |
- name: Run tests (Debug) | |
working-directory: ${{env.DEBUG_BUILD_DIR}} | |
run: ./hktests-dbg --gtest_output=xml:hktests-dbg.xml | |
- name: Run tests (Release) | |
working-directory: ${{env.RELEASE_BUILD_DIR}} | |
run: ./hktests-rel --gtest_output=xml:hktests-rel.xml | |