Skip to content

Commit

Permalink
Update actions/checkout to v4 (#4751)
Browse files Browse the repository at this point in the history
* Update actions/checkout to v4

* Use dtolnay rust action instead of deprecated action-rs

* Use dtolnay rust action (2)

* Use dtolnay rust action (3)

* Update JamesIves action for ci doc
  • Loading branch information
sydhds authored Oct 1, 2024
1 parent 149a6e1 commit 6990fe6
Showing 1 changed file with 32 additions and 59 deletions.
91 changes: 32 additions & 59 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,41 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# Actions doc / www page:
# actions/checkout: https://github.com/actions/checkout
# Swatinem/rust-cache: https://github.com/Swatinem/rust-cache
# dtolnay/rust-toolchain: https://github.com/dtolnay/rust-toolchain
# codecov/codecov-action: https://github.com/codecov/codecov-action

jobs:
# Quick tests on each commit/PR
sanity:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: 1.81.0
components: rustfmt
override: true
- uses: Swatinem/rust-cache@v2
with:
shared-key: "sanity"
save-if: ${{ github.ref_name == 'main' }}
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- run: cargo fmt --all --check

check:
if: github.ref != 'refs/heads/staging'
needs: sanity
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: 1.81.0
- uses: Swatinem/rust-cache@v2
with:
Expand All @@ -66,25 +66,21 @@ jobs:
with:
version: '23.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-rs/cargo@v1
with:
command: check
- run: cargo check

clippy:
if: github.ref != 'refs/heads/staging'
needs: sanity
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: 1.81.0
components: clippy
override: true
- uses: Swatinem/rust-cache@v2
with:
shared-key: "clippy"
Expand All @@ -93,18 +89,15 @@ jobs:
with:
version: '23.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --no-deps --all-targets
- run: cargo clippy --no-deps --all-targets

security:
if: github.ref != 'refs/heads/staging'
needs: sanity
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: "recursive"
# - uses: actions-rust-lang/audit@v1
Expand Down Expand Up @@ -185,14 +178,12 @@ jobs:
if: runner.os == 'Linux'
run: df -h
- uses: ilammy/setup-nasm@v1
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: 1.81.0
override: true
- uses: Swatinem/rust-cache@v2
with:
shared-key: "massa"
Expand All @@ -202,22 +193,11 @@ jobs:
version: "23.x"
include-pre-releases: false
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-rs/cargo@v1
with:
command: install
args: cargo-nextest --locked
- uses: actions-rs/cargo@v1
with:
command: nextest
args: run --retries 10 --profile ci --all-features
- uses: actions-rs/cargo@v1
with:
command: clean
- uses: actions-rs/cargo@v1
with:
command: test
args: --doc
- uses: codecov/codecov-action@v3
- run: cargo install cargo-nextest --locked
- run: cargo nextest run --retries 10 --profile ci --all-features
- run: cargo clean
- run: cargo test --doc
- uses: codecov/codecov-action@v4
with:
files: lcov.info
fail_ci_if_error: false
Expand All @@ -233,21 +213,19 @@ jobs:
if: github.ref != 'refs/heads/staging' && github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: 1.81.0
components: rustfmt
override: true
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: massalabs/gas-calibration
path: gas-calibration
ref: main
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: massalabs/massa-as-sdk
path: massa-as-sdk
Expand All @@ -268,15 +246,13 @@ jobs:
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: 1.81.0
components: rustfmt
override: true
- uses: Swatinem/rust-cache@v2
with:
shared-key: "doc"
Expand All @@ -285,19 +261,16 @@ jobs:
with:
version: '23.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --document-private-items
- uses: JamesIves/[email protected]
- run: cargo doc --no-deps --document-private-items
- uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: target/doc

unit_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: setup_tests
Expand Down

0 comments on commit 6990fe6

Please sign in to comment.