diff --git a/.github/workflows/ci.yml b/.github/workflows/build.yml similarity index 78% rename from .github/workflows/ci.yml rename to .github/workflows/build.yml index 7be86f6..9248ca5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: ci +name: build on: push: @@ -8,56 +8,6 @@ on: workflow_dispatch: jobs: - fmt: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Cargo cache - uses: actions/cache@v4 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: x86_64-unknown-linux-gnu-cargo-${{ hashFiles('**/Cargo.lock') }} - - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable - - - name: Check fmt - run: cargo fmt --check - - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Cargo cache - uses: actions/cache@v4 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: x86_64-unknown-linux-gnu-cargo-${{ hashFiles('**/Cargo.lock') }} - - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable - - - name: Lint - run: cargo clippy -- -D warnings - build-linux: runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..2d6eaf0 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,58 @@ +name: lint + +on: + push: + branches: + - '*' + pull_request: + +jobs: + fmt: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Cargo cache + uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: x86_64-unknown-linux-gnu-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + + - name: Check fmt + run: cargo fmt --check + + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Cargo cache + uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: x86_64-unknown-linux-gnu-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + + - name: Lint + run: cargo clippy -- -D warnings