Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
danieletorelli committed Aug 21, 2024
1 parent 2f9442d commit 579c9e4
Showing 1 changed file with 24 additions and 29 deletions.
53 changes: 24 additions & 29 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,48 @@ name: CI

on:
push:
tags:
- 'v*.*.*'
branches:
- main
tags: [ 'v*.*.*' ]
branches: [ '**' ]
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-is
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Check formatting
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy -- -Dwarnings
- name: Tests
run: cargo test --all-features
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-is
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Check formatting
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy -- -Dwarnings
- name: Tests
run: cargo test --all-features --test all

publish:
needs: [ build ]
if: "startsWith(github.ref, 'refs/tags/v')"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand All @@ -56,7 +52,6 @@ jobs:
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-is

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
Expand Down

0 comments on commit 579c9e4

Please sign in to comment.