From 8e4ecdb72facd4ec2d3843b69c39223d46862a96 Mon Sep 17 00:00:00 2001 From: Joe Richey Date: Mon, 31 Oct 2022 00:05:08 -0700 Subject: [PATCH 1/8] Use "host" instead of "target" in Web Tests Signed-off-by: Joe Richey --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5bc7f320..b311ba62 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -192,12 +192,12 @@ jobs: matrix: include: - os: ubuntu-latest - target: x86_64-unknown-linux-musl + host: x86_64-unknown-linux-musl - os: windows-latest - target: x86_64-pc-windows-msvc + host: x86_64-pc-windows-msvc # Reenable when Safari tests start working # - os: macos-12 - # target: x86_64-apple-darwin + # host: x86_64-apple-darwin runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -208,7 +208,7 @@ jobs: shell: bash run: | VERSION=v0.10.3 - URL=https://github.com/rustwasm/wasm-pack/releases/download/${VERSION}/wasm-pack-${VERSION}-${{ matrix.target }}.tar.gz + URL=https://github.com/rustwasm/wasm-pack/releases/download/${VERSION}/wasm-pack-${VERSION}-${{ matrix.host }}.tar.gz wget -O - $URL | tar -xz --strip-components=1 -C ~/.cargo/bin wasm-pack --version - uses: Swatinem/rust-cache@v2 From 5ddec2a8f4411d6fc336817d931c0d6f76275403 Mon Sep 17 00:00:00 2001 From: Joe Richey Date: Sun, 30 Oct 2022 20:48:41 -0700 Subject: [PATCH 2/8] Check OS using runner.os instead of matrix.os This makes it easier to later update the OS verions Signed-off-by: Joe Richey --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b311ba62..389d0ee7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -203,7 +203,7 @@ jobs: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable - run: choco install wget - if: matrix.os == 'windows-latest' + if: runner.os == 'Windows' - name: Install precompiled wasm-pack shell: bash run: | @@ -219,11 +219,11 @@ jobs: - name: Test (Chrome) run: wasm-pack test --headless --chrome --features=js,test-in-browser - name: Test (Edge) - if: matrix.os == 'windows-latest' + if: runner.os == 'Windows' run: wasm-pack test --headless --chrome --chromedriver $Env:EDGEWEBDRIVER\msedgedriver.exe --features=js,test-in-browser # Safari tests are broken: https://github.com/rustwasm/wasm-bindgen/issues/3004 # - name: Test (Safari) - # if: matrix.os == 'macos-12' + # if: runner.os == 'macOS' # run: wasm-pack test --headless --safari --features=js,test-in-browser - name: Test (custom getrandom) run: wasm-pack test --node --features=custom From 941c2fff69cf7cc2d2f925a09139fb2ce1ba4682 Mon Sep 17 00:00:00 2001 From: Joe Richey Date: Sun, 30 Oct 2022 20:43:28 -0700 Subject: [PATCH 3/8] Update tests to run on Ubuntu 22.04 (instead of 20.04) Signed-off-by: Joe Richey --- .github/workflows/tests.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 389d0ee7..0aa88a15 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ env: jobs: check-doc: name: Docs, deadlinks, minimal dependencies - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@nightly # Needed for -Z minimal-versions and doc_cfg @@ -41,7 +41,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-22.04, windows-latest] toolchain: [nightly, beta, stable, 1.36] # Only Test macOS on stable to reduce macOS CI jobs include: @@ -61,7 +61,7 @@ jobs: linux-tests: name: Linux Test - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: target: [ @@ -127,7 +127,7 @@ jobs: cross-tests: name: Cross Test - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: target: [ @@ -164,7 +164,7 @@ jobs: cross-link: name: Cross Build/Link - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: target: [ @@ -191,7 +191,7 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-latest + - os: ubuntu-22.04 host: x86_64-unknown-linux-musl - os: windows-latest host: x86_64-pc-windows-msvc @@ -230,7 +230,7 @@ jobs: wasm64-tests: name: wasm64 Build/Link - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@nightly # Need to build libstd @@ -245,7 +245,7 @@ jobs: wasi-tests: name: WASI Test - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable @@ -262,7 +262,7 @@ jobs: build-tier2: name: Tier 2 Build - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: target: [ @@ -281,7 +281,7 @@ jobs: build-tier3: name: Tier 3 Build - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: # Supported tier 3 targets without libstd support @@ -318,7 +318,7 @@ jobs: clippy-fmt: name: Clippy + rustfmt - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v1 - uses: dtolnay/rust-toolchain@stable From 9d4a91f9a13521b0174cfed054a29b06dcde7165 Mon Sep 17 00:00:00 2001 From: Joe Richey Date: Sun, 30 Oct 2022 20:44:47 -0700 Subject: [PATCH 4/8] Remove workaround not needed on Ubuntu 22.04 Signed-off-by: Joe Richey --- .github/workflows/tests.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0aa88a15..62948da6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -75,11 +75,7 @@ jobs: with: targets: ${{ matrix.target }} - name: Install multilib - # update is needed to fix the 404 error on install, see: - # https://github.com/actions/virtual-environments/issues/675 - run: | - sudo apt-get update - sudo apt-get install gcc-multilib + run: sudo apt-get install gcc-multilib - uses: Swatinem/rust-cache@v2 - run: cargo test --target=${{ matrix.target }} --features=std From b04bd03e146bc43b78782d5e07ee75a257bb93da Mon Sep 17 00:00:00 2001 From: Joe Richey Date: Sun, 30 Oct 2022 20:50:41 -0700 Subject: [PATCH 5/8] Explicitly use windows-2022 Currently this is the same as `windows-latest` so this is not a functional change. Signed-off-by: Joe Richey --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 62948da6..27ec6691 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,7 +41,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, windows-latest] + os: [ubuntu-22.04, windows-2022] toolchain: [nightly, beta, stable, 1.36] # Only Test macOS on stable to reduce macOS CI jobs include: @@ -105,7 +105,7 @@ jobs: windows-tests: name: Windows Test - runs-on: windows-latest + runs-on: windows-2022 strategy: matrix: toolchain: [ @@ -189,7 +189,7 @@ jobs: include: - os: ubuntu-22.04 host: x86_64-unknown-linux-musl - - os: windows-latest + - os: windows-2022 host: x86_64-pc-windows-msvc # Reenable when Safari tests start working # - os: macos-12 From 62e697f9ca2d11dedd1fd5f09907622e7c9f7017 Mon Sep 17 00:00:00 2001 From: Joe Richey Date: Sun, 30 Oct 2022 21:14:51 -0700 Subject: [PATCH 6/8] Run web tests on 20.04 This is necessary to get Firefox to work. Signed-off-by: Joe Richey --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 27ec6691..63767e62 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -187,7 +187,8 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-22.04 + # Firefox isn't available on 22.04 yet, so we must use 20.04 + - os: ubuntu-20.04 host: x86_64-unknown-linux-musl - os: windows-2022 host: x86_64-pc-windows-msvc From 2e66e5921fe08af63ac81ea8645d0420d767f8d5 Mon Sep 17 00:00:00 2001 From: Joe Richey Date: Sun, 30 Oct 2022 23:57:40 -0700 Subject: [PATCH 7/8] Programaticly select iOS simulator Runtime/Device Signed-off-by: Joe Richey --- .github/workflows/tests.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 63767e62..bd3cf08c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -94,9 +94,15 @@ jobs: wget -O - $URL | tar -xz --strip-components=1 -C ~/.cargo/bin cargo dinghy --version - name: Setup Simulator + # Use the first installed iOS runtime and the first (i.e. oldest) supported iPhone device. run: | - RUNTIME_ID=$(xcrun simctl list runtimes | grep iOS | cut -d ' ' -f 7 | tail -1) - SIM_ID=$(xcrun simctl create My-iphone7 com.apple.CoreSimulator.SimDeviceType.iPhone-7 $RUNTIME_ID) + RUNTIME=$(xcrun simctl list runtimes --json | jq '.runtimes | map(select(.name | contains("iOS"))) | .[0]') + RUNTIME_ID=$(echo $RUNTIME | jq -r '.identifier') + echo "Using runtime:" $RUNTIME_ID + DEVICE_ID=$(echo $RUNTIME | jq -r '.supportedDeviceTypes | map(select(.productFamily == "iPhone")) | .[0].identifier') + echo "Using device:" $DEVICE_ID + SIM_ID=$(xcrun simctl create Test-iPhone $DEVICE_ID $RUNTIME_ID) + echo "Created simulator:" $SIM_ID xcrun simctl boot $SIM_ID echo "device=$SIM_ID" >> $GITHUB_ENV - uses: Swatinem/rust-cache@v2 From f096c04523c23682c15e2661eb40063939e17e46 Mon Sep 17 00:00:00 2001 From: Joe Richey Date: Sun, 30 Oct 2022 21:16:36 -0700 Subject: [PATCH 8/8] Update all runners to macOS 12 Signed-off-by: Joe Richey --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bd3cf08c..acd1acc8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -45,7 +45,7 @@ jobs: toolchain: [nightly, beta, stable, 1.36] # Only Test macOS on stable to reduce macOS CI jobs include: - - os: macos-latest + - os: macos-12 toolchain: stable steps: - uses: actions/checkout@v3 @@ -81,7 +81,7 @@ jobs: ios-tests: name: iOS Simulator Test - runs-on: macos-11 + runs-on: macos-12 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable @@ -152,7 +152,7 @@ jobs: macos-link: name: macOS ARM64 Build/Link - runs-on: macos-latest + runs-on: macos-12 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@nightly