Skip to content

Commit 0a74013

Browse files
authored
Merge pull request #2513 from ehuss/github-deprecated-action-commands
Update deprecated GitHub Actions commands.
2 parents 2b59a3b + f048a68 commit 0a74013

13 files changed

+61
-49
lines changed

.github/workflows/centos-fmt-clippy-on-all.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
mkdir -p ~/.cargo/{registry,git}
3838
- name: Set environment variables appropriately for the build
3939
run: |
40-
echo "::add-path::$HOME/.cargo/bin"
40+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
4141
- name: Cache cargo registry and git trees
4242
uses: actions/cache@v2
4343
with:

.github/workflows/deploy-docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
run: |
1616
mkdir mdbook
1717
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.1/mdbook-v0.4.1-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
18-
echo ::add-path::`pwd`/mdbook
18+
echo "`pwd`/mdbook" >> $GITHUB_PATH
1919
- name: Build book
2020
run: cd doc && mdbook build
2121
- name: Deploy to GitHub

.github/workflows/linux-builds-on-master.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ jobs:
4949
mkdir -p ~/.cargo/{registry,git}
5050
- name: Set environment variables appropriately for the build
5151
run: |
52-
echo "::add-path::$HOME/.cargo/bin"
53-
echo "::set-env name=TARGET::${{matrix.target}}"
52+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
53+
echo "TARGET=${{ matrix.target }}" >> $GITHUB_ENV
5454
- name: Skip tests
5555
run: |
56-
echo "::set-env name=SKIP_TESTS::yes"
56+
echo "SKIP_TESTS=yes" >> $GITHUB_ENV
5757
if: matrix.run_tests == ''
5858
- name: Cache cargo registry and git trees
5959
uses: actions/cache@v2
@@ -91,7 +91,7 @@ jobs:
9191
*-linux-android*) DOCKER=android ;; # Android uses a local docker image
9292
*) DOCKER="$TARGET" ;;
9393
esac
94-
echo "::set-env name=DOCKER::$DOCKER"
94+
echo "DOCKER=$DOCKER" >> $GITHUB_ENV
9595
- name: Fetch the docker
9696
run: bash ci/fetch-rust-docker.bash "${TARGET}"
9797
- name: Maybe build a docker from there

.github/workflows/linux-builds-on-pr.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ jobs:
4242
mkdir -p ~/.cargo/{registry,git}
4343
- name: Set environment variables appropriately for the build
4444
run: |
45-
echo "::add-path::$HOME/.cargo/bin"
46-
echo "::set-env name=TARGET::${{matrix.target}}"
45+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
46+
echo "TARGET=${{ matrix.target }}" >> $GITHUB_ENV
4747
- name: Skip tests
4848
run: |
49-
echo "::set-env name=SKIP_TESTS::yes"
49+
echo "SKIP_TESTS=yes" >> $GITHUB_ENV
5050
if: matrix.run_tests == ''
5151
- name: Cache cargo registry and git trees
5252
uses: actions/cache@v2
@@ -84,7 +84,7 @@ jobs:
8484
*-linux-android*) DOCKER=android ;; # Android uses a local docker image
8585
*) DOCKER="$TARGET" ;;
8686
esac
87-
echo "::set-env name=DOCKER::$DOCKER"
87+
echo "DOCKER=$DOCKER" >> $GITHUB_ENV
8888
- name: Fetch the docker
8989
run: bash ci/fetch-rust-docker.bash "${TARGET}"
9090
- name: Maybe build a docker from there

.github/workflows/linux-builds-on-stable.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ jobs:
7171
mkdir -p ~/.cargo/{registry,git}
7272
- name: Set environment variables appropriately for the build
7373
run: |
74-
echo "::add-path::$HOME/.cargo/bin"
75-
echo "::set-env name=TARGET::${{matrix.target}}"
74+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
75+
echo "TARGET=${{ matrix.target }}" >> $GITHUB_ENV
7676
- name: Skip tests
7777
run: |
78-
echo "::set-env name=SKIP_TESTS::yes"
78+
echo "SKIP_TESTS=yes" >> $GITHUB_ENV
7979
if: matrix.run_tests == ''
8080
- name: Cache cargo registry and git trees
8181
uses: actions/cache@v2
@@ -113,7 +113,7 @@ jobs:
113113
*-linux-android*) DOCKER=android ;; # Android uses a local docker image
114114
*) DOCKER="$TARGET" ;;
115115
esac
116-
echo "::set-env name=DOCKER::$DOCKER"
116+
echo "DOCKER=$DOCKER" >> $GITHUB_ENV
117117
- name: Fetch the docker
118118
run: bash ci/fetch-rust-docker.bash "${TARGET}"
119119
- name: Maybe build a docker from there

.github/workflows/macos-builds-on-all.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ jobs:
3838
mkdir -p ~/.cargo/{registry,git}
3939
- name: Set environment variables appropriately for the build
4040
run: |
41-
echo "::add-path::$HOME/.cargo/bin"
42-
echo "::set-env name=TARGET::${{matrix.target}}"
43-
echo "::set-env name=SKIP_TESTS::"
41+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
42+
echo "TARGET=${{ matrix.target }}" >> $GITHUB_ENV
43+
echo "SKIP_TESTS=" >> $GITHUB_ENV
4444
- name: Cache cargo registry and git trees
4545
uses: actions/cache@v2
4646
with:
@@ -57,8 +57,8 @@ jobs:
5757
uses: actions/cache@v2
5858
with:
5959
path: target
60-
key: ${{ github.base_ref }}-${{ github.head_ref }}-${{ matrix.target }}-cargo-target-dir-${{ steps.cargo-target-cache.outputs.rust_hash }}-${{ hashFiles('**/Cargo.lock') }}
61-
restore-keys: ${{ github.base_ref }}-${{ matrix.target }}-cargo-target-dir-${{ steps.cargo-target-cache.outputs.rust_hash }}-${{ hashFiles('**/Cargo.lock') }}
60+
key: ${{ github.base_ref }}-${{ github.head_ref }}-${{ matrix.target }}-cargo-target-dir-${{ steps.cargo-target-cache.outputs.rust_hash }}-${{ hashFiles('**/Cargo.lock') }}-3
61+
restore-keys: ${{ github.base_ref }}-${{ matrix.target }}-cargo-target-dir-${{ steps.cargo-target-cache.outputs.rust_hash }}-${{ hashFiles('**/Cargo.lock') }}-3
6262
- name: Install Rustup using ./rustup-init.sh
6363
run: |
6464
sh ./rustup-init.sh --default-toolchain=none --profile=minimal -y
@@ -92,3 +92,9 @@ jobs:
9292
run: |
9393
cargo install cargo-cache --no-default-features --features ci-autoclean
9494
cargo-cache
95+
- name: Flush cache
96+
# This is a workaround for a bug with GitHub Actions Cache that causes
97+
# corrupt cache entries (particularly in the target directory). See
98+
# https://github.com/actions/cache/issues/403 and
99+
# https://github.com/rust-lang/cargo/issues/8603.
100+
run: sudo /usr/sbin/purge

.github/workflows/windows-builds-on-master.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ jobs:
5454
Invoke-WebRequest ${{ matrix.mingw }} -OutFile mingw.7z
5555
7z x -y mingw.7z -oC:\msys64 | Out-Null
5656
del mingw.7z
57-
echo ::add-path::C:\msys64\usr\bin
58-
echo ::add-path::C:\msys64\${{ matrix.mingwdir }}\bin
57+
echo "C:\msys64\usr\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
58+
echo "C:\msys64\${{ matrix.mingwdir }}\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
5959
shell: powershell
6060
if: matrix.mingw != ''
6161
- name: Set environment variables appropriately for the build
6262
run: |
63-
echo "::add-path::%USERPROFILE%\.cargo\bin"
64-
echo "::set-env name=TARGET::${{matrix.target}}"
65-
echo "::set-env name=SKIP_TESTS::"
63+
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
64+
echo "TARGET=${{ matrix.target }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
65+
echo "SKIP_TESTS=" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
6666
- name: Cache cargo registry and git trees
6767
uses: actions/cache@v2
6868
with:

.github/workflows/windows-builds-on-pr.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ jobs:
5151
Invoke-WebRequest ${{ matrix.mingw }} -OutFile mingw.7z
5252
7z x -y mingw.7z -oC:\msys64 | Out-Null
5353
del mingw.7z
54-
echo ::add-path::C:\msys64\usr\bin
55-
echo ::add-path::C:\msys64\${{ matrix.mingwdir }}\bin
54+
echo "C:\msys64\usr\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
55+
echo "C:\msys64\${{ matrix.mingwdir }}\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
5656
shell: powershell
5757
if: matrix.mingw != ''
5858
- name: Set environment variables appropriately for the build
5959
run: |
60-
echo "::add-path::%USERPROFILE%\.cargo\bin"
61-
echo "::set-env name=TARGET::${{matrix.target}}"
62-
echo "::set-env name=SKIP_TESTS::"
60+
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
61+
echo "TARGET=${{ matrix.target }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
62+
echo "SKIP_TESTS=" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
6363
- name: Cache cargo registry and git trees
6464
uses: actions/cache@v2
6565
with:

.github/workflows/windows-builds-on-stable.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ jobs:
5454
Invoke-WebRequest ${{ matrix.mingw }} -OutFile mingw.7z
5555
7z x -y mingw.7z -oC:\msys64 | Out-Null
5656
del mingw.7z
57-
echo ::add-path::C:\msys64\usr\bin
58-
echo ::add-path::C:\msys64\${{ matrix.mingwdir }}\bin
57+
echo "C:\msys64\usr\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
58+
echo "C:\msys64\${{ matrix.mingwdir }}\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
5959
shell: powershell
6060
if: matrix.mingw != ''
6161
- name: Set environment variables appropriately for the build
6262
run: |
63-
echo "::add-path::%USERPROFILE%\.cargo\bin"
64-
echo "::set-env name=TARGET::${{matrix.target}}"
65-
echo "::set-env name=SKIP_TESTS::"
63+
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
64+
echo "TARGET=${{ matrix.target }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
65+
echo "SKIP_TESTS=" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
6666
- name: Cache cargo registry and git trees
6767
uses: actions/cache@v2
6868
with:

ci/actions-templates/centos-fmt-clippy-template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
mkdir -p ~/.cargo/{registry,git}
3838
- name: Set environment variables appropriately for the build
3939
run: |
40-
echo "::add-path::$HOME/.cargo/bin"
40+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
4141
- name: Cache cargo registry and git trees
4242
uses: actions/cache@v2
4343
with:

ci/actions-templates/linux-builds-template.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ jobs:
7979
mkdir -p ~/.cargo/{registry,git}
8080
- name: Set environment variables appropriately for the build
8181
run: |
82-
echo "::add-path::$HOME/.cargo/bin"
83-
echo "::set-env name=TARGET::${{matrix.target}}"
82+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
83+
echo "TARGET=${{ matrix.target }}" >> $GITHUB_ENV
8484
- name: Skip tests
8585
run: |
86-
echo "::set-env name=SKIP_TESTS::yes"
86+
echo "SKIP_TESTS=yes" >> $GITHUB_ENV
8787
if: matrix.run_tests == ''
8888
- name: Cache cargo registry and git trees
8989
uses: actions/cache@v2
@@ -121,7 +121,7 @@ jobs:
121121
*-linux-android*) DOCKER=android ;; # Android uses a local docker image
122122
*) DOCKER="$TARGET" ;;
123123
esac
124-
echo "::set-env name=DOCKER::$DOCKER"
124+
echo "DOCKER=$DOCKER" >> $GITHUB_ENV
125125
- name: Fetch the docker
126126
run: bash ci/fetch-rust-docker.bash "${TARGET}"
127127
- name: Maybe build a docker from there

ci/actions-templates/macos-builds-template.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ jobs:
3838
mkdir -p ~/.cargo/{registry,git}
3939
- name: Set environment variables appropriately for the build
4040
run: |
41-
echo "::add-path::$HOME/.cargo/bin"
42-
echo "::set-env name=TARGET::${{matrix.target}}"
43-
echo "::set-env name=SKIP_TESTS::"
41+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
42+
echo "TARGET=${{ matrix.target }}" >> $GITHUB_ENV
43+
echo "SKIP_TESTS=" >> $GITHUB_ENV
4444
- name: Cache cargo registry and git trees
4545
uses: actions/cache@v2
4646
with:
@@ -57,8 +57,8 @@ jobs:
5757
uses: actions/cache@v2
5858
with:
5959
path: target
60-
key: ${{ github.base_ref }}-${{ github.head_ref }}-${{ matrix.target }}-cargo-target-dir-${{ steps.cargo-target-cache.outputs.rust_hash }}-${{ hashFiles('**/Cargo.lock') }}
61-
restore-keys: ${{ github.base_ref }}-${{ matrix.target }}-cargo-target-dir-${{ steps.cargo-target-cache.outputs.rust_hash }}-${{ hashFiles('**/Cargo.lock') }}
60+
key: ${{ github.base_ref }}-${{ github.head_ref }}-${{ matrix.target }}-cargo-target-dir-${{ steps.cargo-target-cache.outputs.rust_hash }}-${{ hashFiles('**/Cargo.lock') }}-3
61+
restore-keys: ${{ github.base_ref }}-${{ matrix.target }}-cargo-target-dir-${{ steps.cargo-target-cache.outputs.rust_hash }}-${{ hashFiles('**/Cargo.lock') }}-3
6262
- name: Install Rustup using ./rustup-init.sh
6363
run: |
6464
sh ./rustup-init.sh --default-toolchain=none --profile=minimal -y
@@ -92,3 +92,9 @@ jobs:
9292
run: |
9393
cargo install cargo-cache --no-default-features --features ci-autoclean
9494
cargo-cache
95+
- name: Flush cache
96+
# This is a workaround for a bug with GitHub Actions Cache that causes
97+
# corrupt cache entries (particularly in the target directory). See
98+
# https://github.com/actions/cache/issues/403 and
99+
# https://github.com/rust-lang/cargo/issues/8603.
100+
run: sudo /usr/sbin/purge

ci/actions-templates/windows-builds-template.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ jobs:
6262
Invoke-WebRequest ${{ matrix.mingw }} -OutFile mingw.7z
6363
7z x -y mingw.7z -oC:\msys64 | Out-Null
6464
del mingw.7z
65-
echo ::add-path::C:\msys64\usr\bin
66-
echo ::add-path::C:\msys64\${{ matrix.mingwdir }}\bin
65+
echo "C:\msys64\usr\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
66+
echo "C:\msys64\${{ matrix.mingwdir }}\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
6767
shell: powershell
6868
if: matrix.mingw != ''
6969
- name: Set environment variables appropriately for the build
7070
run: |
71-
echo "::add-path::%USERPROFILE%\.cargo\bin"
72-
echo "::set-env name=TARGET::${{matrix.target}}"
73-
echo "::set-env name=SKIP_TESTS::"
71+
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
72+
echo "TARGET=${{ matrix.target }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
73+
echo "SKIP_TESTS=" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
7474
- name: Cache cargo registry and git trees
7575
uses: actions/cache@v2
7676
with:

0 commit comments

Comments
 (0)