diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b858a409b..e771ac591 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,10 +20,9 @@ jobs: steps: - uses: actions/checkout@v2 - name: install stable - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - target: ${{ matrix.platform.target }} + targets: ${{ matrix.platform.target }} - name: install webkit2gtk (ubuntu only) if: contains(matrix.platform.target, 'gnu') @@ -38,41 +37,7 @@ jobs: Invoke-WebRequest https://go.microsoft.com/fwlink/p/?LinkId=2124703 -OutFile installwebview.exe -UseBasicParsing cmd /C start /wait installwebview.exe /silent /install - - name: Get current date - run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - - - name: Cache cargo registry - uses: actions/cache@v2.1.4 - with: - path: ~/.cargo/registry - # Add date to the cache to keep it up to date - key: ${{ matrix.platform }}-stable-cargo-registry-${{ hashFiles('Cargo.toml') }}-${{ env.CURRENT_DATE }} - # Restore from outdated cache for speed - restore-keys: | - ${{ matrix.platform }}-stable-cargo-registry-${{ hashFiles('Cargo.toml') }} - ${{ matrix.platform }}-stable-cargo-registry- - - - name: Cache cargo index - uses: actions/cache@v2.1.4 - with: - path: ~/.cargo/git - # Add date to the cache to keep it up to date - key: ${{ matrix.platform }}-stable-cargo-index-${{ hashFiles('Cargo.toml') }}-${{ env.CURRENT_DATE }} - # Restore from outdated cache for speed - restore-keys: | - ${{ matrix.platform }}-stable-cargo-index-${{ hashFiles('Cargo.toml') }} - ${{ matrix.platform }}-stable-cargo-index- - - - name: Cache cargo target - uses: actions/cache@v2 - with: - path: target - # Add date to the cache to keep it up to date - key: ${{ matrix.platform }}-stable-cargo-core-${{ hashFiles('Cargo.toml') }}-${{ env.CURRENT_DATE }} - # Restore from outdated cache for speed - restore-keys: | - ${{ matrix.platform }}-stable-cargo-core-${{ hashFiles('Cargo.toml') }} - ${{ matrix.platform }}-stable-cargo-core- + - uses: Swatinem/rust-cache@v2 - name: build wry run: cargo build --target ${{ matrix.platform.target }} @@ -95,4 +60,3 @@ jobs: contains(matrix.platform.target, 'windows') || contains(matrix.platform.target, 'apple')) run: cargo build --no-default-features --features winit --target ${{ matrix.platform.target }} -