fix: use environment so pull requests from other fork can run ci

wsxiaoys-patch-3
Meng Zhang 2023-11-23 20:17:45 +08:00
parent 2192cc718f
commit 818be1674a
2 changed files with 10 additions and 4 deletions

View File

@ -20,6 +20,9 @@ concurrency:
# If this is enabled it will cancel current running and start latest # If this is enabled it will cancel current running and start latest
cancel-in-progress: true cancel-in-progress: true
env:
RUST_TOOLCHAIN: 1.73.0
jobs: jobs:
tests: tests:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -35,7 +38,7 @@ jobs:
- name: Install Rust - name: Install Rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: ${{ vars.RUST_TOOLCHAIN }} toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: Sccache cache - name: Sccache cache
uses: mozilla-actions/sccache-action@v0.0.3 uses: mozilla-actions/sccache-action@v0.0.3
@ -86,11 +89,11 @@ jobs:
- name: Install Rust - name: Install Rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: ${{ vars.RUST_TOOLCHAIN }} toolchain: ${{ env.RUST_TOOLCHAIN }}
target: ${{ matrix.target }} target: ${{ matrix.target }}
components: clippy components: clippy
- run: rustup default ${{ vars.RUST_TOOLCHAIN }} - run: rustup default ${{ env.RUST_TOOLCHAIN }}
- name: Sccache cache - name: Sccache cache
uses: mozilla-actions/sccache-action@v0.0.3 uses: mozilla-actions/sccache-action@v0.0.3

View File

@ -14,6 +14,9 @@ concurrency:
# If this is enabled it will cancel current running and start latest # If this is enabled it will cancel current running and start latest
cancel-in-progress: true cancel-in-progress: true
env:
RUST_TOOLCHAIN: 1.73.0
jobs: jobs:
release-docker: release-docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -101,7 +104,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
cache-from: ${{ steps.cache.outputs.cache-from }} cache-from: ${{ steps.cache.outputs.cache-from }}
cache-to: ${{ steps.cache.outputs.cache-to }} cache-to: ${{ steps.cache.outputs.cache-to }}
build-args: RUST_TOOLCHAIN=${{ vars.RUST_TOOLCHAIN }} build-args: RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
- name: Docker Hub Description - name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3 uses: peter-evans/dockerhub-description@v3