From b3ae7e2c9e31c7094288a693aa4dc640df67e1a8 Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Tue, 15 Aug 2023 16:46:09 -0700 Subject: [PATCH 1/5] Update all uncommented commands to remove actions-rs (#1) --- .github/workflows/main.yml | 46 ++++++++--------- .github/workflows/playwright.yml | 68 ++++++++++++------------- packages/cli/.github/workflows/main.yml | 34 ++++--------- 3 files changed, 63 insertions(+), 85 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c6e14ab6fb..04f367b8e4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -85,52 +85,56 @@ jobs: matrix_test: runs-on: ${{ matrix.platform.os }} + env: + RUST_CARGO_COMMAND: ${{ matrix.platform.cross == true && 'cross' || 'cargo' }} strategy: matrix: platform: - { target: x86_64-pc-windows-msvc, os: windows-latest, - toolchain: '1.70.0', + toolchain: "1.70.0", cross: false, - command: 'test', - args: '--all --tests' + command: "test", + args: "--all --tests", } - { target: x86_64-apple-darwin, os: macos-latest, - toolchain: '1.70.0', + toolchain: "1.70.0", cross: false, - command: 'test', - args: '--all --tests' + command: "test", + args: "--all --tests", } - { target: aarch64-apple-ios, os: macos-latest, - toolchain: '1.70.0', + toolchain: "1.70.0", cross: false, - command: 'build', - args: '--package dioxus-mobile' + command: "build", + args: "--package dioxus-mobile", } - { target: aarch64-linux-android, os: ubuntu-latest, - toolchain: '1.70.0', + toolchain: "1.70.0", cross: true, - command: 'build', - args: '--package dioxus-mobile' + command: "build", + args: "--package dioxus-mobile", } steps: - uses: actions/checkout@v3 - name: install stable - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.platform.toolchain }} - target: ${{ matrix.platform.target }} - override: true - default: true + targets: ${{ matrix.platform.target }} + + - name: Install cross + if: ${{ matrix.platform.cross == true }} + uses: taiki-e/install-action@cross - uses: Swatinem/rust-cache@v2 with: @@ -138,13 +142,8 @@ jobs: save-if: ${{ matrix.features.key == 'all' }} - name: test - uses: actions-rs/cargo@v1 - with: - use-cross: ${{ matrix.platform.cross }} - command: ${{ matrix.platform.command }} - args: --target ${{ matrix.platform.target }} ${{ matrix.platform.args }} - - + run: | + ${{ env.RUST_CARGO_COMMAND }} ${{ matrix.platform.command }} ${{ matrix.platform.args }} --target ${{ matrix.platform.target }} # Coverage is disabled until we can fix it # coverage: @@ -166,4 +165,3 @@ jobs: # uses: codecov/codecov-action@v2 # with: # fail_ci_if_error: false - diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 41fa92fa79..1b349b0de1 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -1,9 +1,9 @@ name: Playwright Tests on: push: - branches: [ main, master ] + branches: [main, master] pull_request: - branches: [ main, master ] + branches: [main, master] defaults: run: working-directory: ./playwright-tests @@ -18,37 +18,33 @@ jobs: timeout-minutes: 60 runs-on: ubuntu-20.04 steps: - # Do our best to cache the toolchain and node install steps - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: Swatinem/rust-cache@v2 - - name: Install WASM toolchain - run: rustup target add wasm32-unknown-unknown - - name: Install dependencies - run: npm ci - - name: Install Playwright - run: npm install -D @playwright/test - - name: Install Playwright Browsers - run: npx playwright install --with-deps - # Cache the CLI by using cargo run internally - # - name: Install Dioxus CLI - # uses: actions-rs/cargo@v1 - # with: - # command: install - # args: --path packages/cli - - name: Run Playwright tests - run: npx playwright test - - uses: actions/upload-artifact@v3 - if: always() - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 + # Do our best to cache the toolchain and node install steps + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - name: Install WASM toolchain + run: rustup target add wasm32-unknown-unknown + - name: Install dependencies + run: npm ci + - name: Install Playwright + run: npm install -D @playwright/test + - name: Install Playwright Browsers + run: npx playwright install --with-deps + # Cache the CLI by using cargo run internally + # - name: Install Dioxus CLI + # uses: actions-rs/cargo@v1 + # with: + # command: install + # args: --path packages/cli + - name: Run Playwright tests + run: npx playwright test + - uses: actions/upload-artifact@v3 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 diff --git a/packages/cli/.github/workflows/main.yml b/packages/cli/.github/workflows/main.yml index f978ba7a24..b22f78eae2 100644 --- a/packages/cli/.github/workflows/main.yml +++ b/packages/cli/.github/workflows/main.yml @@ -8,47 +8,31 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true + - name: Install Rust + uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v1 - - uses: actions-rs/cargo@v1 - with: - command: check + - run: cargo check test: name: Test Suite runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true + - name: Install Rust + uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v1 - - uses: actions-rs/cargo@v1 - with: - command: test + - run: cargo test fmt: name: Rustfmt runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true + - name: Install Rust + uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v1 - run: rustup component add rustfmt - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + - run: cargo fmt --all -- --check # clippy: # name: Clippy From 3c4947c8b0fabdfc3b858ebc5a2a9974222bf36d Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Tue, 15 Aug 2023 17:38:18 -0700 Subject: [PATCH 2/5] install target in toolchain action --- .github/workflows/playwright.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 1b349b0de1..c56be7eafe 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -24,10 +24,11 @@ jobs: with: node-version: 16 - name: Install Rust - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + targets: wasm32-unknown-unknown - uses: Swatinem/rust-cache@v2 - - name: Install WASM toolchain - run: rustup target add wasm32-unknown-unknown - name: Install dependencies run: npm ci - name: Install Playwright From 89ce996f2cf67f606b129a7bdd78648995a70483 Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Tue, 22 Aug 2023 19:12:56 -0400 Subject: [PATCH 3/5] add linux target explicitly --- .github/workflows/playwright.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index c56be7eafe..adb1ee5eeb 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -27,7 +27,7 @@ jobs: uses: dtolnay/rust-toolchain@master with: toolchain: stable - targets: wasm32-unknown-unknown + targets: x86_64-linux-gnu,wasm32-unknown-unknown - uses: Swatinem/rust-cache@v2 - name: Install dependencies run: npm ci From 74ea6f8be7c04fe09d9ad0c7474e13b807f2bf37 Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Tue, 22 Aug 2023 19:16:05 -0400 Subject: [PATCH 4/5] try latest --- .github/workflows/playwright.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index adb1ee5eeb..25819c8430 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -16,7 +16,7 @@ jobs: test: if: github.event.pull_request.draft == false timeout-minutes: 60 - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: # Do our best to cache the toolchain and node install steps - uses: actions/checkout@v3 From b2c6bfc4ad7848569f792247ebf7183f02748e2c Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Tue, 22 Aug 2023 20:23:44 -0400 Subject: [PATCH 5/5] fix install --- .github/workflows/playwright.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 25819c8430..dba32d2573 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -27,7 +27,7 @@ jobs: uses: dtolnay/rust-toolchain@master with: toolchain: stable - targets: x86_64-linux-gnu,wasm32-unknown-unknown + targets: x86_64-unknown-linux-gnu,wasm32-unknown-unknown - uses: Swatinem/rust-cache@v2 - name: Install dependencies run: npm ci