Bläddra i källkod

Replace unmaintained/outdated GitHub Actions (#811)

Updates all GitHub Actions and replaces the unmaintained `actions-rs`
actions with `dtolnay/rust-toolchain`, `taiki-e/install-action` and
plain cargo commands.
nickelc 3 år sedan
förälder
incheckning
dbe60a4930
2 ändrade filer med 22 tillägg och 51 borttagningar
  1. 7 8
      .github/workflows/codecov.yml
  2. 15 43
      .github/workflows/main.yml

+ 7 - 8
.github/workflows/codecov.yml

@@ -9,17 +9,16 @@ jobs:
   coverage:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v1
-      - uses: actions-rs/toolchain@v1
+      - uses: actions/checkout@v3
+      - uses: dtolnay/rust-toolchain@stable
+      - uses: taiki-e/install-action@v2
         with:
-          profile: minimal
-          toolchain: stable
-          override: true
-      - uses: actions-rs/tarpaulin@v0.1
-      - uses: codecov/codecov-action@v2.1.0
+          tool: cargo-tarpaulin
+      - run: cargo tarpaulin --out Xml
+      - uses: codecov/codecov-action@v3
         # A codecov token is not needed for public repos if the repo is linked
         # on codecov.io. See https://docs.codecov.com/docs/frequently-asked-questions#where-is-the-repository-upload-token-found
-      - uses: actions/upload-artifact@v1
+      - uses: actions/upload-artifact@v2
         with:
           name: code-coverage-report
           path: cobertura.xml

+ 15 - 43
.github/workflows/main.yml

@@ -29,75 +29,47 @@ jobs:
     runs-on: ${{ matrix.os }}
 
     steps:
-      - uses: actions/checkout@v2
-      - uses: actions-rs/toolchain@v1
+      - uses: actions/checkout@v3
+      - uses: dtolnay/rust-toolchain@master
         with:
-          profile: minimal
           toolchain: ${{ matrix.rust }}
-          override: true
-      - uses: actions-rs/cargo@v1
-        with:
-          command: build
-          args: --all-targets
+      - run: cargo build --all-targets
         # Run tests
       - name: Run tests
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
+        run: cargo test
         # Run tests enabling the serde feature
       - name: Run tests with the serde feature
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --features "url/serde,url/expose_internals"
+        run: cargo test --features "url/serde,url/expose_internals"
       # The #[debugger_visualizer] attribute is currently gated behind an unstable feature flag.
       # In order to test the visualizers for the url crate, they have to be tested on a nightly build.
       - name: Run debugger_visualizer tests
         if: |
           matrix.os == 'windows-latest' &&
           matrix.rust == 'nightly'
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --test debugger_visualizer --features "url/serde,url/debugger_visualizer" -- --test-threads=1
+        run: cargo test --test debugger_visualizer --features "url/serde,url/debugger_visualizer" -- --test-threads=1
 
   WASM:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v2
-      - uses: actions-rs/toolchain@v1
+      - uses: actions/checkout@v3
+      - uses: dtolnay/rust-toolchain@stable
         with:
-          profile: minimal
-          toolchain: stable
-          target: wasm32-unknown-unknown
-          override: true
-      - uses: actions-rs/cargo@v1
-        with:
-          command: build
-          args: --target wasm32-unknown-unknown
+          targets: wasm32-unknown-unknown
+      - run: cargo build --target wasm32-unknown-unknown
 
   Lint:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v2
-      - uses: actions-rs/toolchain@v1
+      - uses: actions/checkout@v3
+      - uses: dtolnay/rust-toolchain@stable
         with:
-          profile: minimal
-          toolchain: stable
-          override: true
           components: rustfmt, clippy
-      - uses: actions-rs/cargo@v1
-        with:
-          command: fmt
-          args: --all -- --check
-      - uses: actions-rs/cargo@v1
+      - run: cargo fmt --all --check
+      - run: cargo clippy --workspace --all-targets -- -D warnings
         if: always()
-        with:
-          command: clippy
-          args: --workspace --all-targets -- -D warnings
 
   Audit:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v1
+      - uses: actions/checkout@v3
       - uses: EmbarkStudios/cargo-deny-action@v1