yewprint/.github/workflows/pr.yml

46 lines
1.2 KiB
YAML
Raw Normal View History

name: PR Workflow
on:
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
2020-10-04 11:45:24 +00:00
outputs:
size: ${{ steps.build.outputs.size }}
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`"
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.1
with:
2021-04-13 14:23:12 +00:00
publish-dir: './build'
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
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features -- -D warnings