fix: ? #61
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: | |
- '*' | |
- '!web' # https://github.community/t/github-actions-on-push-not-master/16026/2 | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-main: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build | |
run: | | |
cargo --version | |
cargo build --verbose | |
- name: Test | |
run: cargo test --verbose | |
- name: Clippy | |
run: cargo clippy --verbose | |
- name: Check Format | |
run: cargo fmt -- --check | |
build-web: | |
# if: github.event_name != 'push' || github.ref != 'refs/heads/typearena' # FIX: main | |
needs: build-main | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# wasm-pack-plugin handles all when yarn build. So not necessary. | |
# - uses: jetli/[email protected] | |
# with: | |
# # Optional version of wasm-pack to install(eg. 'v0.9.1', 'latest') | |
# version: 'latest' | |
# - name: Build wasm | |
# run: wasm-pack build | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '16' | |
- name: Init web | |
working-directory: web/ | |
run: | | |
node --version | |
yarn --version | |
yarn install | |
- name: Build | |
working-directory: web/ | |
run: yarn build | |
# - name: Test | |
# working-directory: web/ | |
# run: yarn test # no effective test so far, just to make sure it lints & builds well | |
# build-and-push-web: # push built wasm pkg to a branch for CF pages.dev | |
# if: github.event_name == 'push' && github.ref == 'refs/heads/typearena' # FIX: main | |
# needs: build-main | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# fetch-depth: 0 | |
# - name: "Prepare git and repo" | |
# run: | | |
# git config user.name github-actions | |
# git config user.email [email protected] | |
# git switch web | |
# git merge "${GITHUB_REF#refs/heads/}" | |
# - uses: jetli/[email protected] | |
# with: | |
# # Optional version of wasm-pack to install(eg. 'v0.9.1', 'latest') | |
# version: 'latest' | |
# - name: Build wasm | |
# run: wasm-pack build --release | |
# - uses: actions/setup-node@v1 | |
# with: | |
# node-version: '15' | |
# - name: Init web | |
# working-directory: web/ | |
# run: | | |
# node --version | |
# yarn --version | |
# yarn install | |
# - name: Build | |
# working-directory: web/ | |
# run: yarn build | |
# - name: Push to web branch" | |
# run: | | |
# git add -f web/build/ | |
# git add -f pkg/ | |
# git diff-index --quiet HEAD || git commit -m "Build wasm and web for ${GITHUB_SHA::7}" | |
# git push |