Skip to content
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
54 changes: 0 additions & 54 deletions .github/workflows/check_pr.yml

This file was deleted.

70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: CI

on:
push:
branches: ['master']
pull_request:
branches: ['**']

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

jobs:
audit:
name: Audit
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4

- name: cargo-audit cache restore
id: cargo-audit_cache_restore
uses: actions/cache/restore@v4
with:
path: ~/.cargo/bin/cargo-audit
key: ${{ runner.os }}-cargo-audit

- run: cargo install cargo-audit
if: steps.cargo-audit_cache_restore.outputs.cache-hit != 'true'

- name: cargo-audit cache save
id: cargo-audit_cache_save
uses: actions/cache/save@v4
if: always() && steps.cargo-audit_cache_restore.outputs.cache-hit != 'true'
with:
path: ~/.cargo/bin/cargo-audit
key: ${{ runner.os }}-cargo-audit

- uses: rustsec/audit-check@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}

lint-and-test:
name: Lint and Test
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
targets: wasm32-unknown-unknown

- name: Cache cargo build artifacts
uses: Swatinem/rust-cache@v2

- name: Run cargo clippy
run: |
cargo clippy --all-targets --features tokio -- -D warnings
cargo clippy --all-targets --target wasm32-unknown-unknown -- -D warnings

- name: Run cargo test
run: |
cargo test --features tokio
cargo test --doc
77 changes: 77 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Adopted from https://github.com/azriel91/peace/blob/main/.github/workflows/publish.yml
# Copyright 2023 Azriel Hoh MIT / Apache-2.0

name: Publish

on:
push:
tags:
- "*"

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

jobs:
build_and_test_linux:
name: Build and Test (Linux)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

- name: Install cargo-rdme
uses: taiki-e/install-action@v2
with:
tool: cargo-rdme

- name: "Is readme up to date?"
run: cargo rdme --check

- name: "Build and test"
run: cargo test

crates_io_publish:
name: Publish (crates.io)
needs:
- build_and_test_linux

runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

- name: cargo-release cache restore
id: cargo_release_cache_restore
uses: actions/cache/restore@v4
with:
path: ~/.cargo/bin/cargo-release
key: ${{ runner.os }}-cargo-release

- run: cargo install cargo-release
if: steps.cargo_release_cache_restore.outputs.cache-hit != 'true'

- name: cargo-release cache save
id: cargo_release_cache_save
uses: actions/cache/save@v4
if: always() && steps.cargo_release_cache_restore.outputs.cache-hit != 'true'
with:
path: ~/.cargo/bin/cargo-release
key: ${{ runner.os }}-cargo-release

- name: cargo login
run: |-
echo "${{ secrets.CRATES_IO_API_TOKEN }}" | cargo login

# allow-branch HEAD is because GitHub actions switches
# to the tag while building, which is a detached head
- name: "cargo release publish"
run: |-
cargo release \
publish \
--workspace \
--allow-branch HEAD \
--no-confirm \
--execute
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
target/
**/*.rs.bk
Cargo.lock
.idea
/.direnv/
Loading
Loading