Update BuildAndTestOnPush.yml #34
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: Build, Test, and Package | |
on: | |
push: | |
branches: | |
- develop | |
- 'feat-*' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
toolchain: [stable, beta, nightly] | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
workdir: [RektBroker, RektCommon] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
- name: Update toolchain | |
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} | |
working-directory: ${{ matrix.workdir }} | |
- name: Install CMake (Linux) | |
run: sudo apt-get update && sudo apt-get install -y cmake | |
working-directory: ${{ matrix.workdir }} | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
- name: Install CMake (macOS) | |
run: brew update && brew install cmake | |
working-directory: ${{ matrix.workdir }} | |
if: ${{ matrix.os == 'macOS-latest' }} | |
- name: Install Chocolatey pkg (Windozs only) | |
# You may pin to the exact commit or the version. | |
# uses: crazy-max/ghaction-chocolatey@0e015857dd851f84fcb7fb53380eb5c4c8202333 | |
uses: crazy-max/ghaction-chocolatey@v3.0.0 | |
with: | |
# Arguments to pass to Chocolatey | |
# Docker image to use | |
image: ghcr.io/crazy-max/ghaction-chocolatey | |
if: ${{ matrix.os == 'windows-latest' }} | |
- name: Install CMake (Windows) | |
run: choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' | |
working-directory: ${{ matrix.workdir }} | |
if: ${{ matrix.os == 'windows-latest' }} | |
- name: Build for ${{ matrix.os }} | |
run: cargo build --release | |
working-directory: ${{ matrix.workdir }} | |
- name: Run Tests | |
run: cargo test | |
working-directory: ${{ matrix.workdir }} |