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
|
2021-03-22 13:42:42 +03:00
|
|
|
RUST_LOG: "debug"
|
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
|
|
|
|
|
2021-03-22 13:42:42 +03:00
|
|
|
check:
|
|
|
|
name: Check
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- ubuntu-latest
|
|
|
|
- macos-10.15
|
|
|
|
- windows-2019
|
2021-01-22 12:39:57 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-03-22 13:42:42 +03:00
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/
|
|
|
|
target
|
|
|
|
key: ${{ runner.os }}-cargo
|
|
|
|
# Ensure that all components are compilable.
|
2021-01-22 12:39:57 +03:00
|
|
|
- name: Run cargo check for all targets
|
|
|
|
run: cargo check --color always --all --all-targets
|
2020-05-22 14:36:39 +03:00
|
|
|
test:
|
2021-03-22 13:42:42 +03:00
|
|
|
name: Test
|
|
|
|
needs:
|
|
|
|
- check
|
|
|
|
runs-on: ${{ matrix.os }}
|
2021-01-22 12:39:57 +03:00
|
|
|
strategy:
|
2021-02-19 09:34:22 +03:00
|
|
|
fail-fast: false
|
2021-01-22 12:39:57 +03:00
|
|
|
matrix:
|
2021-03-22 13:42:42 +03:00
|
|
|
os:
|
|
|
|
- ubuntu-latest
|
|
|
|
- macos-10.15
|
|
|
|
- windows-2019
|
2021-01-22 12:39:57 +03:00
|
|
|
crate:
|
|
|
|
- ast_node
|
|
|
|
- enum_kind
|
|
|
|
- from_variant
|
|
|
|
- jsdoc
|
|
|
|
- spack
|
|
|
|
- string_enum
|
|
|
|
- swc
|
|
|
|
- swc_atoms
|
|
|
|
- swc_bundler
|
|
|
|
- swc_common
|
|
|
|
- swc_ecma_ast
|
|
|
|
- swc_ecma_codegen
|
|
|
|
- swc_ecma_codegen_macros
|
|
|
|
- swc_ecma_dep_graph
|
|
|
|
- swc_ecma_ext_transforms
|
2021-03-22 13:42:42 +03:00
|
|
|
- swc_ecma_loader
|
2021-01-22 12:39:57 +03:00
|
|
|
- swc_ecma_parser
|
|
|
|
- swc_ecma_preset_env
|
|
|
|
- swc_ecma_transforms
|
|
|
|
- swc_ecma_transforms_base
|
|
|
|
- swc_ecma_transforms_compat
|
|
|
|
- swc_ecma_transforms_macros
|
|
|
|
- swc_ecma_transforms_module
|
|
|
|
- swc_ecma_transforms_optimization
|
|
|
|
- swc_ecma_transforms_proposal
|
|
|
|
- swc_ecma_transforms_react
|
|
|
|
- swc_ecma_transforms_testing
|
|
|
|
- swc_ecma_transforms_typescript
|
|
|
|
- swc_ecma_utils
|
|
|
|
- swc_ecma_visit
|
|
|
|
- swc_ecmascript
|
|
|
|
- swc_eq_ignore_macros
|
|
|
|
- swc_macros_common
|
|
|
|
- swc_visit
|
|
|
|
- swc_visit_macros
|
|
|
|
- testing
|
|
|
|
- testing_macros
|
2021-03-22 13:42:42 +03:00
|
|
|
exclude:
|
|
|
|
- os: windows-2019
|
|
|
|
crate: spack
|
2021-01-22 12:39:57 +03:00
|
|
|
|
2020-01-04 07:33:25 +03:00
|
|
|
steps:
|
2021-03-22 13:42:42 +03:00
|
|
|
- name: Handle line endings
|
|
|
|
shell: bash
|
|
|
|
if: runner.os == 'Windows'
|
|
|
|
run: |
|
|
|
|
git config --system core.autocrlf false
|
|
|
|
git config --system core.eol lf
|
|
|
|
|
2020-01-04 07:33:25 +03:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2021-01-11 13:39:17 +03:00
|
|
|
- uses: actions/setup-node@v2
|
2020-08-30 09:29:42 +03:00
|
|
|
with:
|
2021-01-11 13:39:17 +03:00
|
|
|
node-version: 14
|
2020-05-22 14:36:39 +03:00
|
|
|
|
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
|
2021-03-22 13:42:42 +03:00
|
|
|
shell: bash
|
2020-01-04 07:33:25 +03:00
|
|
|
run: |
|
2021-03-22 13:42:42 +03:00
|
|
|
# This does not have any effect on windows.
|
|
|
|
npm config set prefix $HOME/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
|
2021-03-22 13:42:42 +03:00
|
|
|
echo $HOME
|
|
|
|
echo $HOME/npm/bin >> $GITHUB_PATH
|
|
|
|
|
|
|
|
- name: Configure path (windows)
|
|
|
|
shell: bash
|
|
|
|
if: runner.os == 'Windows'
|
|
|
|
run: |
|
|
|
|
echo 'C:\\npm\\prefix' >> $GITHUB_PATH
|
|
|
|
|
|
|
|
- name: Verify dependencies
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
jest -v
|
2020-01-04 07:33:25 +03:00
|
|
|
|
2020-08-03 19:33:23 +03:00
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/
|
2021-03-22 13:42:42 +03:00
|
|
|
target
|
|
|
|
key: ${{ runner.os }}-cargo
|
2020-08-03 19:33:23 +03:00
|
|
|
|
2021-01-05 08:29:52 +03:00
|
|
|
- name: Run cargo test
|
2020-01-04 07:33:25 +03:00
|
|
|
run: |
|
2021-03-22 13:42:42 +03:00
|
|
|
jest -v
|
2021-01-22 12:39:57 +03:00
|
|
|
cargo test --color always -p ${{ matrix.crate }}
|
2021-03-17 09:24:35 +03:00
|
|
|
|
|
|
|
# We use travis for rustdocs
|
|
|
|
# deploy-docs:
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
# if: github.ref == 'refs/heads/master'
|
|
|
|
# needs:
|
|
|
|
# - test
|
|
|
|
# steps:
|
|
|
|
# - uses: actions/checkout@v2
|
|
|
|
# - name: Create rustdoc
|
|
|
|
# run: cargo doc
|