-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
78 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,49 @@ | ||
# a composite action, as described here: | ||
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action | ||
name: "Build and test app" | ||
description: "Build and test app on different platforms" | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build_linux: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
os: [linux] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: ⚡ Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | ||
|
||
- name: Build and test | ||
run: | | ||
# Commands to build and test the app | ||
build_windows: | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
os: [windows] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: ⚡ Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Install dependencies | ||
run: choco install protoc | ||
|
||
- name: Build and test | ||
run: | | ||
# Commands to build and test the app | ||
build_macos: | ||
runs-on: macOS-latest | ||
strategy: | ||
matrix: | ||
os: [macOS] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: ⚡ Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Install dependencies | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: ⚡ Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- name: 📦 Install protoc | ||
shell: bash | ||
if: runner.os == 'Linux' | ||
run: sudo apt-get install -y protobuf-compiler | ||
if: runner.os == 'macOS' | ||
run: brew install protobuf | ||
if: runner.os == 'Windows' | ||
run: choco install protoc | ||
|
||
- name: Build and test | ||
run: | | ||
# Commands to build and test the app | ||
- name: 🔨 Build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release --all-features | ||
|
||
- name: 🔎 Test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --release | ||
|
||
# https://stackoverflow.com/a/64702025/12555423 | ||
# these will be used once we add integration tests | ||
# - name: ⚙ Integration test | ||
# uses: actions-rs/cargo@v1 | ||
# with: | ||
# command: test | ||
# args: --release --features "integration_tests" |