@@ -2,6 +2,9 @@ name: test
22
33on : [pull_request]
44
5+ permissions :
6+ contents : read
7+
58jobs :
69 test :
710 strategy :
@@ -14,11 +17,11 @@ jobs:
1417 runs-on : ${{ matrix.platform.os }}
1518
1619 steps :
17- - uses : actions/checkout@v2
20+ - uses : actions/checkout@v7
21+
1822 - name : install stable
19- uses : actions-rs/ toolchain@v1
23+ uses : dtolnay/rust- toolchain@stable
2024 with :
21- toolchain : stable
2225 target : ${{ matrix.platform.target }}
2326
2427 - name : install webkit2gtk (ubuntu only)
@@ -27,47 +30,10 @@ jobs:
2730 sudo apt-get update
2831 sudo apt-get install -y webkit2gtk-4.1
2932
30- - name : Get current date
31- run : echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
32-
33- - name : Cache cargo registry
34- uses : actions/cache@v2.1.4
35- with :
36- path : ~/.cargo/registry
37- # Add date to the cache to keep it up to date
38- key : ${{ matrix.platform }}-stable-cargo-registry-${{ hashFiles('Cargo.toml') }}-${{ env.CURRENT_DATE }}
39- # Restore from outdated cache for speed
40- restore-keys : |
41- ${{ matrix.platform }}-stable-cargo-registry-${{ hashFiles('Cargo.toml') }}
42- ${{ matrix.platform }}-stable-cargo-registry-
43-
44- - name : Cache cargo index
45- uses : actions/cache@v2.1.4
46- with :
47- path : ~/.cargo/git
48- # Add date to the cache to keep it up to date
49- key : ${{ matrix.platform }}-stable-cargo-index-${{ hashFiles('Cargo.toml') }}-${{ env.CURRENT_DATE }}
50- # Restore from outdated cache for speed
51- restore-keys : |
52- ${{ matrix.platform }}-stable-cargo-index-${{ hashFiles('Cargo.toml') }}
53- ${{ matrix.platform }}-stable-cargo-index-
54-
55- - name : Cache cargo target
56- uses : actions/cache@v2
57- with :
58- path : target
59- # Add date to the cache to keep it up to date
60- key : ${{ matrix.platform }}-stable-cargo-core-${{ hashFiles('Cargo.toml') }}-${{ env.CURRENT_DATE }}
61- # Restore from outdated cache for speed
62- restore-keys : |
63- ${{ matrix.platform }}-stable-cargo-core-${{ hashFiles('Cargo.toml') }}
64- ${{ matrix.platform }}-stable-cargo-core-
33+ - uses : Swatinem/rust-cache@v2
6534
6635 - name : Cargo fmt
67- uses : actions-rs/cargo@v1
68- with :
69- command : fmt
70- args : --all -- --check
36+ run : cargo fmt --all -- --check
7137
7238 - name : build javascriptcore
7339 run : cargo build --target ${{ matrix.platform.target }}
0 commit comments