Skip to content

Commit

Permalink
Fix CI (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
Diggsey committed Oct 15, 2023
1 parent c1d7ad4 commit 387b301
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 88 deletions.
23 changes: 5 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,10 @@ jobs:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: login
args: -- ${{secrets.CARGO_TOKEN}}
- uses: actions-rs/cargo@v1
with:
command: publish
args: --manifest-path sqlxmq_macros/Cargo.toml
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo login ${{secrets.CARGO_TOKEN}}
- run: cargo publish --manifest-path sqlxmq_macros/Cargo.toml
- name: Wait for crates.io to update
run: sleep 30
- uses: actions-rs/cargo@v1
with:
command: publish
args: --manifest-path Cargo.toml
- run: cargo publish --manifest-path Cargo.toml
97 changes: 27 additions & 70 deletions .github/workflows/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,108 +7,65 @@ jobs:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: check
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo check

fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
command: fmt
args: -- --check
components: rustfmt
- run: cargo fmt -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- -D warnings
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-targets -- -D warnings

test:
name: Test
runs-on: ubuntu-latest
env:
RUST_BACKTRACE: "1"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/install@v0.1
with:
crate: sqlx-cli
use-tool-cache: true
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo install sqlx-cli --locked
- uses: ./.github/actions/postgres
- uses: actions-rs/cargo@v1
with:
command: test
args: -- --nocapture
- run: cargo test -- --nocapture

test_nightly:
name: Test (Nightly)
runs-on: ubuntu-latest
env:
RUST_BACKTRACE: "1"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: actions-rs/install@v0.1
with:
crate: sqlx-cli
use-tool-cache: true
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- run: cargo install sqlx-cli --locked
- uses: ./.github/actions/postgres
- uses: actions-rs/cargo@v1
with:
command: test
args: -- --nocapture
- run: cargo test -- --nocapture

readme:
name: Readme
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install rust stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install cargo-sync-readme
uses: actions-rs/install@v0.1
with:
crate: cargo-sync-readme
version: latest
use-tool-cache: true
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo install cargo-sync-readme --locked
- name: Sync readme
run: cargo sync-readme -c

0 comments on commit 387b301

Please sign in to comment.