diff --git a/.github/workflows/bors.yml b/.github/workflows/bors.yml new file mode 100644 index 0000000000..03408f5132 --- /dev/null +++ b/.github/workflows/bors.yml @@ -0,0 +1,181 @@ +name: bors + +on: + push: + branches: + - staging + - trying + +jobs: + test_on_linux: + name: Tests on Linux + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.5 + - uses: actions-rs/toolchain@v1.0.7 + with: + toolchain: stable + override: true + profile: minimal + - name: Cache cargo + uses: actions/cache@v2.1.6 + with: + path: | + target + ~/.cargo/git + ~/.cargo/registry + key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} + - uses: actions-rs/cargo@v1 + with: + command: test + args: -v + test_vm_on_linux: + name: Tests on Linux with vm enabled + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.5 + - uses: actions-rs/toolchain@v1.0.7 + with: + toolchain: stable + override: true + profile: minimal + - name: Cache cargo + uses: actions/cache@v2.1.6 + with: + path: | + target + ~/.cargo/git + ~/.cargo/registry + key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} + - uses: actions-rs/cargo@v1 + with: + command: test + args: ---package Boa --lib --features=vm -- vm --nocapture + + test_on_windows: + name: Tests on Windows + runs-on: windows-latest + steps: + - uses: actions/checkout@v2.3.5 + - uses: actions-rs/toolchain@v1.0.7 + with: + toolchain: stable + override: true + profile: minimal + - name: Cache cargo + uses: actions/cache@v2.1.6 + with: + path: target + key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} + - uses: actions-rs/cargo@v1 + with: + command: test + args: -v + + test_on_macos: + name: Tests on MacOS + runs-on: macos-latest + steps: + - uses: actions/checkout@v2.3.5 + - uses: actions-rs/toolchain@v1.0.7 + with: + toolchain: stable + override: true + profile: minimal + - uses: actions-rs/cargo@v1 + with: + command: test + args: -v + + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.5 + - uses: actions-rs/toolchain@v1.0.7 + with: + toolchain: stable + override: true + profile: minimal + components: rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.5 + - uses: actions-rs/toolchain@v1.0.7 + with: + toolchain: stable + override: true + profile: minimal + components: clippy + - name: Cache cargo + uses: actions/cache@v2.1.6 + with: + path: | + target + ~/.cargo/git + ~/.cargo/registry + key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }} + - uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- --verbose + + examples: + name: Examples + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.5 + - uses: actions-rs/toolchain@v1.0.7 + with: + toolchain: stable + override: true + profile: minimal + - name: Cache cargo + uses: actions/cache@v2.1.6 + with: + path: | + target + ~/.cargo/git + ~/.cargo/registry + key: ${{ runner.os }}-cargo-examples-${{ hashFiles('**/Cargo.lock') }} + - name: Build examples + uses: actions-rs/cargo@v1 + with: + command: build + args: --examples -v + - name: Run example classes + uses: actions-rs/cargo@v1 + with: + command: run + args: --example classes + + doc: + name: Documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.5 + - uses: actions-rs/toolchain@v1.0.7 + with: + toolchain: stable + override: true + profile: minimal + - name: Cache cargo + uses: actions/cache@v2.1.6 + with: + path: | + target + ~/.cargo/git + ~/.cargo/registry + key: ${{ runner.os }}-cargo-doc-${{ hashFiles('**/Cargo.lock') }} + - name: Generate documentation + uses: actions-rs/cargo@v1 + with: + command: doc + args: -v --document-private-items diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index eb7c6297ff..bdbbdb6caa 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -9,66 +9,8 @@ on: name: Continuous integration jobs: - check_on_linux: - name: Check on Linux - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2.3.5 - - uses: actions-rs/toolchain@v1.0.7 - with: - toolchain: stable - override: true - profile: minimal - - name: Cache cargo - uses: actions/cache@v2.1.6 - with: - path: | - target - ~/.cargo/git - ~/.cargo/registry - key: ${{ runner.os }}-cargo-check-${{ hashFiles('**/Cargo.lock') }} - - uses: actions-rs/cargo@v1 - with: - command: check - args: -v - - check_on_windows: - name: Check on Windows - runs-on: windows-latest - steps: - - uses: actions/checkout@v2.3.5 - - uses: actions-rs/toolchain@v1.0.7 - with: - toolchain: stable - override: true - profile: minimal - - name: Cache cargo build - uses: actions/cache@v2.1.6 - with: - path: target - key: ${{ runner.os }}-cargo-check-${{ hashFiles('**/Cargo.lock') }} - - uses: actions-rs/cargo@v1 - with: - command: check - args: -v - - check_on_macos: - name: Check on MacOS - runs-on: macos-latest - steps: - - uses: actions/checkout@v2.3.5 - - uses: actions-rs/toolchain@v1.0.7 - with: - toolchain: stable - override: true - profile: minimal - - uses: actions-rs/cargo@v1 - with: - command: check - args: -v - test_on_linux: - name: Test Suite on Linux + name: Tests on Linux runs-on: ubuntu-latest steps: - uses: actions/checkout@v2.3.5 @@ -85,19 +27,14 @@ jobs: ~/.cargo/git ~/.cargo/registry key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} - - uses: actions-rs/cargo@v1 + - name: Run cargo-tarpaulin + uses: actions-rs/tarpaulin@v0.1 with: - command: test - args: -v - # Waiting for https://github.com/rust-lang/cargo/pull/9229 to land - # - name: Run cargo-tarpaulin - # uses: actions-rs/tarpaulin@v0.1 - # with: - # args: --ignore-tests - # - name: Upload to codecov.io - # uses: codecov/codecov-action@v1 + args: --ignore-tests + - name: Upload to codecov.io + uses: codecov/codecov-action@v1 test_vm_on_linux: - name: Test VM on Linux + name: Tests on Linux with vm enabled runs-on: ubuntu-latest steps: - uses: actions/checkout@v2.3.5 @@ -120,7 +57,7 @@ jobs: args: ---package Boa --lib --features=vm -- vm --nocapture test_on_windows: - name: Test Suite on Windows + name: Tests on Windows runs-on: windows-latest steps: - uses: actions/checkout@v2.3.5 @@ -140,7 +77,7 @@ jobs: args: -v test_on_macos: - name: Test Suite on MacOS + name: Tests on MacOS runs-on: macos-latest steps: - uses: actions/checkout@v2.3.5 @@ -224,7 +161,7 @@ jobs: args: --example classes doc: - name: Documentation check + name: Documentation runs-on: ubuntu-latest steps: - uses: actions/checkout@v2.3.5 diff --git a/bors.toml b/bors.toml new file mode 100644 index 0000000000..7dfa104d56 --- /dev/null +++ b/bors.toml @@ -0,0 +1,26 @@ +# docs https://bors.tech/documentation/ +status = [ + "Tests on Linux", + "Tests on Linux with vm enabled", + "Tests on Windows", + "Tests on MacOS", + "Rustfmt", + "Clippy", + "Examples", + "Documentation", +] +pr_status = [ + "Tests on Linux", + "Tests on Linux with vm enabled", + "Tests on Windows", + "Tests on MacOS", + "Rustfmt", + "Clippy", + "Examples", + "Documentation", +] +block_labels = [ "blocked" ] +required_approvals = 2 +delete_merged_branches = true +use_squash_merge = true +update_base_for_deletes = true