Skip to content

Commit

Permalink
Merge pull request #21 from negezor/update-ci
Browse files Browse the repository at this point in the history
Update GitHub Actions CI
  • Loading branch information
bahlo authored Oct 8, 2024
2 parents f5bd510 + fef435b commit a0a2ca2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v4
- name: Run audit check
uses: actions-rs/audit-check@v1
uses: rustsec/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
48 changes: 18 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,62 +16,57 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/cache@v2
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
run: cargo fmt -- --check
clippy_check:
name: Clippy check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
- uses: actions/cache@v2
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install clippy
run: rustup component add clippy
- name: Run clippy check
uses: actions-rs/clippy-check@v1
uses: dtolnay/rust-toolchain@stable
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
components: clippy
- name: Run clippy check
run: cargo clippy --all-features

test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/cache@v2
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
run: cargo test
publish_on_crates_io:
name: Publish on crates.io
runs-on: ubuntu-latest
Expand All @@ -82,15 +77,8 @@ jobs:
- test
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install rust
uses: actions-rs/toolchain@v1
- name: Run cargo login
uses: actions-rs/cargo@v1
with:
command: login
args: ${{ secrets.CRATES_IO_TOKEN }}
uses: dtolnay/rust-toolchain@stable
- name: Run cargo publish
uses: actions-rs/cargo@v1
with:
command: publish
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}

0 comments on commit a0a2ca2

Please sign in to comment.