NinaPeng is testing out GitHub Actions π #46
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: GitHub Actions Demo | |
run-name: ${{ github.actor }} is testing out GitHub Actions π | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
jobs: | |
pr_and_merge_ci: | |
runs-on: ubuntu-latest | |
container: | |
image: probrian35/vectorcxx_dev:latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Cargo Cache | |
id: cache-build | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
~/.cache/sccache/ | |
build-cmake-relwithdebinfo-linux/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- if: ${{ steps.cache-build.outputs.cache-hit == 'true' }} | |
name: Echo if build cache hit | |
continue-on-error: true | |
run: echo "cargo build cache hit" | |
- name: Build | |
env: | |
RUST_TOOLCHAIN_VERSION: 1.74 | |
BUILD_TYPE: relwithdebinfo | |
RUSTC_WRAPPER: /usr/local/bin/sccache | |
run: rustup component add rust-src && rustup default 1.74-x86_64-unknown-linux-gnu && VECTORCXX_VCPKG_MANIFEST_DIR=$PWD/ci/dev_image just cmake && just build | |
- name: Test | |
run: cd build-cmake-relwithdebinfo-linux && ctest | |
- name: Clear Temp Files | |
run: rm -rf build-cmake-relwithdebinfo-linux/vcpkg_installed |