Skip to content

Commit

Permalink
add cargo test, update paths
Browse files Browse the repository at this point in the history
  • Loading branch information
mpwsh committed Oct 3, 2023
1 parent 06cfafb commit 83ae9ab
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ jobs:
name: ${{ env.REPOSITORY }}-${{ matrix.target }}
path: ./target/release/${{ env.REPOSITORY }}${{ matrix.suffix }}
if-no-files-found: error

release:
needs:
- build
Expand All @@ -116,6 +117,11 @@ jobs:
lfs: true
- uses: actions/download-artifact@v3

- name: Move binaries
run: |
mv ~/work/hub-cli/hub-cli/* .
ls
- name: Release
uses: softprops/action-gh-release@v1
env:
Expand All @@ -125,7 +131,7 @@ jobs:
draft: true
fail_on_unmatched_files: true
files: |
./${{ env.REPOSITORY }}/${{ env.REPOSITORY }}-x86_64-apple-darwin
./${{ env.REPOSITORY }}/${{ env.REPOSITORY }}-x86_64-unknown-linux-gnu
./${{ env.REPOSITORY }}/${{ env.REPOSITORY }}-x86_64-pc-windows-msvc
./${{ env.REPOSITORY }}/${{ env.REPOSITORY }}-aarch64-apple-darwin
${{ env.REPOSITORY }}-x86_64-apple-darwin
${{ env.REPOSITORY }}-x86_64-unknown-linux-gnu
${{ env.REPOSITORY }}-x86_64-pc-windows-msvc
${{ env.REPOSITORY }}-aarch64-apple-darwin
86 changes: 86 additions & 0 deletions .github/workflows/cargo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Cargo

on:
push:
branches:
- main
- release
pull_request:
branches:
- "**"

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

jobs:
clippy:
name: clippy/check/doc
runs-on: amd64
steps:
- name: Install dependencies
run: |
sudo apt-get update -y && \
sudo apt-get install -y --no-install-recommends \
libssl-dev \
pkg-config
- uses: actions/checkout@v3
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: 1.69.0
override: true
components: rustfmt, clippy

- uses: tespkg/actions-cache@v1
with:
accessKey: ${{ secrets.AWS_ACCESS_KEY_ID }}
secretKey: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
bucket: ${{ vars.AWS_BUCKET }}
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ github.event.repository.name }}-${{ runner.arch }}-cargo-clippy-${{ hashFiles('**/Cargo.lock', 'rust-toolchain.toml') }}

- name: cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --all-features

- name: cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --all-features --release

- name: check lockfile
run: |
diff Cargo.lock <(git show HEAD:Cargo.lock)
- name: cargo doc
uses: actions-rs/cargo@v1
with:
command: doc
args: --workspace --all-features

fmt:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-12-11
override: true
components: rustfmt, clippy
- name: cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --check

0 comments on commit 83ae9ab

Please sign in to comment.