Skip to content

Commit

Permalink
Add Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikayex committed Mar 23, 2021
1 parent ace624a commit a914cac
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Rust

on: [ push, pull_request ]

env:
CARGO_TERM_COLOR: always

jobs:
desktop:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
rust: [ stable, nightly ]

steps:
- uses: actions/checkout@v2

- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
override: true

- name: Check
uses: actions-rs/cargo@v1
with:
command: check

- name: Rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check

- name: Test
uses: actions-rs/cargo@v1
with:
command: test

web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Build examples
run: |
for example in `find examples -maxdepth 1 -mindepth 1 -type d -printf "%f\n"` ; do
if [ -f "examples/$example/Cargo.toml" ]; then
echo "::group::Build $example example"
wasm-pack build examples/$example --target web --out-name web --out-dir ../../pkg --dev
echo "::endgroup::"
fi
done

0 comments on commit a914cac

Please sign in to comment.