From 334d71a57abd4d273e144c5e1ec6e6d79f33c8e2 Mon Sep 17 00:00:00 2001 From: vicanso Date: Tue, 15 Oct 2024 19:53:19 +0800 Subject: [PATCH] chore: update workflow --- .github/workflows/windows.yml | 49 ++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 050d36e8..8f937b36 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -11,17 +11,42 @@ env: jobs: windows: runs-on: windows-latest + name: ${{ matrix.target }} + env: + CFG_RELEASE_CHANNEL: ${{ matrix.cfg_release_channel }} + strategy: + # https://help.github.com/en/actions/getting-started-with-github-actions/about-github-actions#usage-limits + # There's a limit of 60 concurrent jobs across all repos in the rust-lang organization. + # In order to prevent overusing too much of that 60 limit, we throttle the + # number of rustfmt jobs that will run concurrently. + matrix: + target: [x86_64-pc-windows-gnu, x86_64-pc-windows-msvc] + steps: - - uses: actions/checkout@v4 - - name: setup node - uses: actions/setup-node@v4 - - name: build-web - run: make build-web - - name: Install toolchain - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - targets: x86_64-pc-windows-gnu - - name: Run cargo release + # The Windows runners have autocrlf enabled by default + # which causes failures for some of rustfmt's line-ending sensitive tests + - name: disable git eol translation + run: git config --global core.autocrlf false + - name: checkout + uses: actions/checkout@v4 + + # Run build + - name: Install Rustup using win.rustup.rs + run: | + # Disable the download progress bar which can cause perf issues + $ProgressPreference = "SilentlyContinue" + Invoke-WebRequest https://win.rustup.rs/ -OutFile rustup-init.exe + .\rustup-init.exe -y --default-host=x86_64-pc-windows-msvc --default-toolchain=none + del rustup-init.exe + rustup target add ${{ matrix.target }} + shell: powershell + + - name: Add mingw64 to path for x86_64-gnu + run: echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH + if: matrix.target == 'x86_64-pc-windows-gnu' && matrix.channel == 'nightly' + shell: bash + + - name: Build and Test + shell: bash run: | - cargo build --release --features=tracking + cargo --version