From cfb9e0df93fb8ac774c3d38d51a5c8818fd6184d Mon Sep 17 00:00:00 2001 From: FL03 Date: Sat, 19 Oct 2024 23:19:09 -0500 Subject: [PATCH] update .github/workflows Signed-off-by: FL03 --- .github/workflows/clippy.yml | 2 +- .github/workflows/crates.yml | 22 ++++++++++++++++++---- .github/workflows/rust.yml | 28 ++++++++++++++-------------- Cargo.toml | 4 ++-- 4 files changed, 35 insertions(+), 21 deletions(-) diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index ce4e70e..89a036c 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -5,7 +5,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} on: - pull_request: + push: branches: [ main ] release: repository_dispatch: diff --git a/.github/workflows/crates.yml b/.github/workflows/crates.yml index 28e7877..b3038de 100644 --- a/.github/workflows/crates.yml +++ b/.github/workflows/crates.yml @@ -1,11 +1,10 @@ -name: crates +name: crates-io concurrency: cancel-in-progress: false group: ${{ github.workflow }}-${{ github.ref }} env: - BASENAME: ${{ github.event.repository.name }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} CARGO_TERM_COLOR: always @@ -20,8 +19,23 @@ permissions: write-all jobs: publish: - name: Publish SDK + env: + CRATENAME: ${{ github.event.repository.name }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - run: cargo publish --all-features -v -p ${{ github.event.repository.name }} --token ${{ secrets.CARGO_REGISTRY_TOKEN }} \ No newline at end of file + - + name: publish + run: cargo publish --all-features -v -p ${{ github.event.repository.name }} + - + name: cache + uses: actions/cache@v4 + with: + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + path: | + ~/.cargo/registry + ~/.cargo/git + target + restore-keys: | + ${{ runner.os }}-cargo- + ${{ runner.os }}- diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7b17b18..4f76638 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -8,8 +8,6 @@ env: CARGO_TERM_COLOR: always on: - pull_request: - branches: [ main ] push: branches: [ main ] release: @@ -24,35 +22,37 @@ permissions: write-all jobs: workspace: - name: Workspace + runs-on: ${{ matrix.platform }} strategy: matrix: - platform: [ macos-latest, ubuntu-latest, windows-latest ] + platform: [ ubuntu-latest ] # [ ubuntu-latest, macos-latest, windows-latest ] toolchain: [ stable, nightly ] - runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v4 - - name: setup (rustup) + - + name: rustup run: | rustup default ${{ matrix.toolchain }} rustup update - - name: build (workspace) + - + name: build run: cargo build --all-features -r -v --workspace - - name: test (workspace) + - + name: test run: cargo test --all-features -v --workspace - - name: bench (workspace) + - + name: bench (workspace) if: matrix.toolchain == 'nightly' run: cargo bench -F full -v --workspace - - name: cache + - + name: cache uses: actions/cache@v4 with: - key: ${{ runner.os }}-cargo-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} path: | ~/.cargo/registry ~/.cargo/git - target/release + target restore-keys: | - ${{ runner.os }}-cargo-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }} - ${{ runner.os }}-cargo-${{ matrix.toolchain }}- ${{ runner.os }}-cargo- ${{ runner.os }}- diff --git a/Cargo.toml b/Cargo.toml index fa90b57..241243b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,11 +20,11 @@ thiserror = "1" [workspace.package] authors = ["FL03 ",] -categories = [ ] +categories = [ "wasm" ] description = "fyber focuses on facilitating communications between various wasm instances" edition = "2021" homepage = "https://github.com/FL03/fyber/wiki" -keywords = [ ] +keywords = ["channel", "communication", "state"] license = "Apache-2.0" readme = "README.md" repository = "https://github.com/FL03/fyber.git"