From f0139fe42ed0b5b0c5d5ec2b6113056a9b03182d Mon Sep 17 00:00:00 2001 From: raskad <32105367+raskad@users.noreply.github.com> Date: Sat, 11 May 2024 01:32:35 +0200 Subject: [PATCH 1/2] Replace archived github actions from actions-rs --- .github/workflows/pull_request.yml | 8 ++- .github/workflows/release.yml | 9 +-- .github/workflows/rust.yml | 91 ++++++++++++++++++---------- .github/workflows/security_audit.yml | 5 +- .github/workflows/test262.yml | 6 +- .github/workflows/webassembly.yml | 8 ++- 6 files changed, 84 insertions(+), 43 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 1f7b720445f..f90d5dd520f 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -12,12 +12,16 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 120 steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: dtolnay/rust-toolchain@stable + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable with: toolchain: stable + - name: Cache cargo uses: actions/cache@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3385334e062..b9982f43d81 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,9 +20,7 @@ jobs: toolchain: stable - name: Install cargo-workspaces - uses: actions-rs/install@v0.1 - with: - crate: cargo-workspaces + run: cargo install cargo-workspaces - name: Release env: @@ -99,11 +97,14 @@ jobs: binary_name: boa.exe runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: toolchain: stable + - name: Build run: cargo build --target ${{ matrix.target }} --verbose --release --locked --bin boa - name: Upload binaries to release diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9526392b25d..8b8929fb5ba 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,10 +19,14 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable with: toolchain: stable + - uses: Swatinem/rust-cache@v2 with: key: tarpaulin @@ -30,11 +34,10 @@ jobs: uses: baptiste0928/cargo-install@v3.1.0 with: crate: cargo-tarpaulin + - name: Run tarpaulin - uses: actions-rs/cargo@v1 - with: - command: tarpaulin - args: --workspace --features annex-b,intl_bundled,experimental --ignore-tests --engine llvm --out xml + run: cargo tarpaulin --workspace --features annex-b,intl_bundled,experimental --ignore-tests --engine llvm --out xml + - name: Upload to codecov.io uses: codecov/codecov-action@v4 @@ -48,10 +51,14 @@ jobs: - macos-latest - windows-latest steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable with: toolchain: stable + - uses: Swatinem/rust-cache@v2 - name: Build tests run: cargo test --no-run --profile ci @@ -70,14 +77,18 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 + # Get the rust_version from the Cargo.toml - name: Get rust_version id: rust_version run: echo "rust_version=$(grep '^rust-version' Cargo.toml | cut -d' ' -f3 | tr -d '"')" >> $GITHUB_OUTPUT - - uses: dtolnay/rust-toolchain@stable - with: + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable toolchain: ${{ steps.rust_version.outputs.rust_version }} + - name: Check compilation run: cargo check --all-features --all-targets @@ -86,11 +97,15 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable with: toolchain: stable components: rustfmt + - name: Format (rustfmt) run: cargo fmt --all --check @@ -99,18 +114,22 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable with: toolchain: stable components: clippy + - uses: Swatinem/rust-cache@v2 with: key: clippy + - name: Install cargo-workspaces - uses: actions-rs/install@v0.1 - with: - crate: cargo-workspaces + run: cargo install cargo-workspaces + - name: Clippy (All features) run: cargo workspaces exec cargo clippy --all-features --all-targets - name: Clippy (No features) @@ -129,10 +148,14 @@ jobs: env: RUSTDOCFLAGS: -D warnings steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable with: toolchain: stable + - uses: Swatinem/rust-cache@v2 with: key: docs @@ -144,18 +167,21 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable with: toolchain: stable + - uses: Swatinem/rust-cache@v2 with: key: build-fuzz + - name: Install cargo-fuzz - uses: actions-rs/install@v0.1 - with: - crate: cargo-fuzz - version: latest + run: cargo install cargo-fuzz + - name: Build fuzz run: cd tests/fuzz && cargo fuzz build -s none --dev @@ -164,17 +190,20 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable with: toolchain: stable + - uses: Swatinem/rust-cache@v2 with: key: build-run-examples + - name: Install cargo-workspaces - uses: actions-rs/install@v0.1 - with: - crate: cargo-workspaces + run: cargo install cargo-workspaces - name: Build (All features) run: cargo workspaces exec cargo build --all-features --all-targets --profile ci diff --git a/.github/workflows/security_audit.yml b/.github/workflows/security_audit.yml index 8fde86a9fa8..fd4fb530ff7 100644 --- a/.github/workflows/security_audit.yml +++ b/.github/workflows/security_audit.yml @@ -7,7 +7,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v4 - - uses: actions-rs/audit-check@v1.2.0 + - name: Checkout repository + uses: actions/checkout@v4 + - uses: rustsec/audit-check@v1.4.1 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test262.yml b/.github/workflows/test262.yml index be17998cc14..8d1c55d0c97 100644 --- a/.github/workflows/test262.yml +++ b/.github/workflows/test262.yml @@ -12,15 +12,17 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - name: Checkout the repository + - name: Checkout repository uses: actions/checkout@v4 with: submodules: true path: boa - - name: Install the Rust toolchain + + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: toolchain: stable + - name: Cache cargo uses: actions/cache@v4 with: diff --git a/.github/workflows/webassembly.yml b/.github/workflows/webassembly.yml index cb41ab05b04..2ac89d3abf6 100644 --- a/.github/workflows/webassembly.yml +++ b/.github/workflows/webassembly.yml @@ -29,10 +29,14 @@ jobs: WASM_PACK_PATH: ~/.cargo/bin/wasm-pack RUSTFLAGS: -D warnings steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable with: toolchain: stable + - uses: Swatinem/rust-cache@v2 - name: Install wasm-pack uses: baptiste0928/cargo-install@v3.1.0 From fee63b9c57304713df349369b8a2e916c43d3d63 Mon Sep 17 00:00:00 2001 From: raskad <32105367+raskad@users.noreply.github.com> Date: Sat, 11 May 2024 01:43:49 +0200 Subject: [PATCH 2/2] fix syntax error --- .github/workflows/rust.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8b8929fb5ba..189da64b52e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -87,6 +87,7 @@ jobs: - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable + with: toolchain: ${{ steps.rust_version.outputs.rust_version }} - name: Check compilation