Merge pull request #34 from corn-config/build/deps #107
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 | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Update Toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
components: clippy | |
- uses: Swatinem/rust-cache@v2 | |
name: Cache dependencies | |
- name: Install Lua | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y --no-install-recommends liblua5.4-dev | |
- name: Rustfmt | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --check | |
- name: Cargo Clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
# only enable one lua feature since they're mutually exclusive | |
args: --all-targets --features wasm,lua54,bench -- -D warnings | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Update Toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: Swatinem/rust-cache@v2 | |
name: Cache dependencies | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
- name: Cargo Test | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --profile release | |
env: | |
CORN_TEST: bar | |
build-wasm: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macos-latest ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Update Toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: Swatinem/rust-cache@v2 | |
name: Cache dependencies | |
- name: Install wasm-pack | |
uses: jetli/[email protected] | |
with: | |
version: 'latest' | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --features wasm | |
- name: Wasm-Pack Test | |
run: wasm-pack test --node | |
working-directory: libcorn | |
build-lua: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
lua: [ lua51, lua52, lua53, lua54, luajit, luajit52 ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Update Toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: Swatinem/rust-cache@v2 | |
name: Cache dependencies | |
- name: Install Lua | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y --no-install-recommends liblua5.4-dev liblua5.3-dev liblua5.2-dev liblua5.1-0-dev libluajit-5.1-dev | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --features ${{ matrix.lua }} |