Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for crate publishing #208

Merged
merged 5 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 111 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,66 @@ on:
branches:
- main
- release-*
tags:
- v*.*.*
pull_request:
branches:
- main
- release-*
workflow_dispatch:
env:
RUSTFLAGS: "--cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\""

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
lint:
runs-on: ubuntu-latest
env:
RUST_LOG: info
RUSTFLAGS: "--cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\""
steps:
- uses: actions/checkout@v4
name: Checkout Repository

- uses: Swatinem/rust-cache@v2
name: Enable Rust Caching
with:
cache-on-failure: true

- name: Format Check
run: cargo fmt -- --check

- uses: actions-rs/clippy-check@v1
name: Clippy
- name: Clippy
uses: actions-rs-plus/clippy-check@v1
with:
token: ${{ github.token }}
args: --workspace --all-features --all-targets -- -D warnings
token: ${{ github.token }}
args: --workspace --all-features --all-targets -- -D warnings

build:
runs-on: ubuntu-latest
env:
RUST_LOG: info
RUSTFLAGS: "--cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\""
steps:
- uses: actions/checkout@v4
name: Checkout Repository

- name: Audit
run: cargo audit --ignore RUSTSEC-2023-0065
- uses: Swatinem/rust-cache@v2
name: Enable Rust Caching

- name: Build
run: cargo build --all-features --all-targets --release

build-windows:
runs-on: windows-2022
env:
RUST_LOG: info
RUSTFLAGS: "--cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\""
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- uses: Swatinem/rust-cache@v2
name: Enable Rust Caching

- name: Build
run: |
Expand All @@ -44,9 +76,40 @@ jobs:
cargo test --workspace --release --all-features --verbose -- --test-threads 2
timeout-minutes: 30

test:
runs-on: ubuntu-latest
env:
RUST_LOG: info
RUSTFLAGS: "--cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\""
steps:
- uses: actions/checkout@v4
name: Checkout Repository

- uses: Swatinem/rust-cache@v2
name: Enable Rust Caching

- name: Build tests
run: cargo test --workspace --release --all-features --no-run

- name: Test
run: cargo test --workspace --release --all-features --verbose -- --test-threads 2
timeout-minutes: 60

docs:
runs-on: ubuntu-latest
env:
RUST_LOG: info
RUSTFLAGS: "--cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\""
steps:
- uses: actions/checkout@v4
name: Checkout Repository

- uses: Swatinem/rust-cache@v2
name: Enable Rust Caching

- name: Generate Documentation
run: |
cargo doc --no-deps --lib --release
cargo doc --no-deps --lib --release --all-features
echo '<meta http-equiv="refresh" content="0; url=tide_disco">' > target/doc/index.html

- name: Deploy Documentation
Expand All @@ -56,3 +119,39 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc
cname: tide-disco.docs.espressosys.com

# semver-check:
# runs-on: ubuntu-latest
# env:
# RUST_LOG: info
# RUSTFLAGS: "--cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\""
# steps:
# - uses: actions/checkout@v4
# name: Checkout Repository

# - uses: Swatinem/rust-cache@v2
# name: Enable Rust Caching

# - name: Check semver
# uses: obi1kenobi/cargo-semver-checks-action@v2

publish:
needs:
- build
- build-windows
- test
- lint
- docs
# - semver-check
runs-on: ubuntu-latest
env:
RUST_LOG: info
RUSTFLAGS: "--cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\""
steps:
- uses: actions/checkout@v4
- uses: katyo/publish-crates@v2
with:
# Only do an actual publish if this is a push to a release tag. Otherwise, do a dry run.
dry-run: ${{ !(github.event_name == 'push' && github.ref_type == 'tag') }}
ignore-unpublished-changes: true
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
42 changes: 0 additions & 42 deletions .github/workflows/build_windows.yml

This file was deleted.

69 changes: 52 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading