2020-11-28 12:54:24 +00:00
|
|
|
name: PR Workflow
|
2020-09-29 07:18:21 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches: [ main ]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
2020-11-28 12:54:24 +00:00
|
|
|
build:
|
2020-09-29 07:18:21 +00:00
|
|
|
runs-on: ubuntu-latest
|
2020-10-04 11:45:24 +00:00
|
|
|
outputs:
|
|
|
|
size: ${{ steps.build.outputs.size }}
|
2020-09-29 07:18:21 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-03-09 10:43:51 +00:00
|
|
|
- uses: Swatinem/rust-cache@v1
|
2020-10-01 06:05:23 +00:00
|
|
|
- run: cargo test --all-features --verbose
|
2020-10-04 11:45:24 +00:00
|
|
|
- name: Build (Release)
|
|
|
|
id: build
|
2021-04-13 14:23:12 +00:00
|
|
|
run: "cargo run -- build && echo ::set-output name=size::`cat build/wasm_bg.wasm | wc -c`"
|
2020-11-28 12:54:24 +00:00
|
|
|
- name: Deploy to Netlify
|
|
|
|
uses: nwtgck/actions-netlify@v1.1
|
|
|
|
with:
|
2021-04-13 14:23:12 +00:00
|
|
|
publish-dir: './build'
|
2020-11-28 12:54:24 +00:00
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
deploy-message: ${{ github.event.pull_request.title }}
|
|
|
|
env:
|
|
|
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
|
|
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
|
|
|
timeout-minutes: 1
|
2020-10-04 11:45:24 +00:00
|
|
|
|
2020-10-01 06:05:23 +00:00
|
|
|
checks:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- run: rustup install --profile default nightly
|
|
|
|
# NOTE: we use nightly here to enable the options error_on_line_overflow and
|
|
|
|
# error_on_unformatted
|
|
|
|
- run: cargo +nightly fmt -- --check
|
2020-09-29 07:18:21 +00:00
|
|
|
- uses: actions-rs/clippy-check@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
args: --all-features -- -D warnings
|