2020-01-04 07:33:25 +03:00
|
|
|
name: Cargo
|
|
|
|
|
2020-02-18 06:27:13 +03:00
|
|
|
on: [push, pull_request]
|
2020-02-18 05:36:56 +03:00
|
|
|
#on:
|
|
|
|
# push:
|
|
|
|
# # Ignore commits created by bors
|
|
|
|
# branches-ignore:
|
|
|
|
# - 'staging'
|
|
|
|
# - 'trying'
|
|
|
|
# pull_request:
|
|
|
|
# branches-ignore:
|
|
|
|
# - 'staging'
|
|
|
|
# - 'trying'
|
2020-01-04 07:33:25 +03:00
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
CI: "1"
|
2020-05-22 14:36:39 +03:00
|
|
|
SKIP_SWC_BINARY_DOWNLOAD_FOR_CI: 1
|
2020-01-04 07:33:25 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
fmt:
|
2020-01-17 12:44:51 +03:00
|
|
|
name: fmt
|
2020-01-04 07:33:25 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-05-16 14:42:49 +03:00
|
|
|
- name: Install rustfmt
|
2020-05-19 09:05:22 +03:00
|
|
|
run: rustup component add rustfmt
|
2020-01-04 07:33:25 +03:00
|
|
|
- name: Run cargo fmt
|
|
|
|
run: cargo fmt --all -- --check
|
|
|
|
|
2020-05-22 14:36:39 +03:00
|
|
|
test:
|
|
|
|
name: test
|
2020-01-04 07:33:25 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2020-05-22 14:36:39 +03:00
|
|
|
# - uses: actions/setup-node@v2-beta
|
|
|
|
# with:
|
|
|
|
# node-version: '12'
|
|
|
|
|
2020-01-04 07:33:25 +03:00
|
|
|
- name: Checkout submodules
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
|
|
|
git submodule sync --recursive
|
|
|
|
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
|
|
|
|
|
|
|
|
- name: Install node dependencies
|
|
|
|
run: |
|
|
|
|
npm config set prefix ~/npm
|
2020-06-17 17:48:34 +03:00
|
|
|
npm i browserslist regenerator-runtime sourcemap-validator progress
|
2020-01-04 07:33:25 +03:00
|
|
|
npm i -g jest
|
|
|
|
|
|
|
|
# Ensure that all components all compilable.
|
|
|
|
- name: Run cargo check for all targets
|
|
|
|
run: cargo check --color always --all --all-targets
|
|
|
|
|
2020-06-02 13:22:41 +03:00
|
|
|
|
|
|
|
- name: Download typescript parser test suite
|
|
|
|
run: |
|
|
|
|
git clone --depth 1 https://github.com/swc-project/ts-parser-test-ref.git ecmascript/parser/tests/typescript/tsc
|
|
|
|
|
2020-01-04 07:33:25 +03:00
|
|
|
- name: Run cargo test
|
|
|
|
run: |
|
|
|
|
export PATH="$PATH:$HOME/npm/bin"
|
2020-06-29 10:23:33 +03:00
|
|
|
cargo test --color always --all --exclude swc_ecma_parser
|
2020-01-04 07:33:25 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
deploy-docs:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: github.ref == 'refs/heads/master'
|
|
|
|
needs:
|
2020-05-22 14:36:39 +03:00
|
|
|
- test
|
2020-01-04 07:33:25 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Create rustdoc
|
|
|
|
run: cargo doc
|