Skip to content

Commit

Permalink
split build for browser tests entirely
Browse files Browse the repository at this point in the history
  • Loading branch information
torokati44 committed Oct 9, 2024
1 parent c9032a4 commit 843a98c
Showing 1 changed file with 50 additions and 5 deletions.
55 changes: 50 additions & 5 deletions .github/workflows/test_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,62 @@ jobs:
working-directory: web
run: npm test

build-for-browser-tests:
needs: changes
if: needs.changes.outputs.should_run == 'true'
name: Build for browser tests
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: web/package-lock.json

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown

- name: Cache Cargo output
uses: Swatinem/rust-cache@v2
with:
shared-key: "web"
save-if: false

# wasm-bindgen-cli version must match wasm-bindgen crate version.
# Be sure to update in release_nightly.yml, Cargo.toml, web/docker/Dockerfile,
# and web/README.md as well.
- name: Install wasm-bindgen
run: cargo install wasm-bindgen-cli --version 0.2.93

# No real need to install wasm-opt here

- name: Build selfhosted
env:
RUSTFLAGS: -D warnings
# Verify that all features build.
CARGO_FLAGS: --all-features
working-directory: web
shell: bash -l {0}
run: |
npm ci
npm run build --workspace=ruffle-core
npm run build --workspace=ruffle-selfhosted
- name: Upload artifacts
if: matrix.os == 'ubuntu-24.04' && matrix.node_version == '22'
uses: actions/upload-artifact@v4
with:
name: selfhosted-dist
path: web/packages/selfhosted/dist


browser-tests:
# Only the instance that uploads the artifact is really needed, but there's no way to express that.
# See: https://github.com/orgs/community/discussions/42335
needs: build
needs: build-for-browser-tests
if: needs.changes.outputs.should_run == 'true'
name: Test in ${{ matrix.browser }}
runs-on: ubuntu-24.04
Expand All @@ -126,7 +171,7 @@ jobs:
cache: npm
cache-dependency-path: web/package-lock.json

- name: Download artifacts
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: selfhosted-dist
Expand Down

0 comments on commit 843a98c

Please sign in to comment.