-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (51 loc) · 1.93 KB
/
BuildAndTestOnPush.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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 }}