tidy + fix test #303
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
release: | |
types: [published] | |
push: | |
paths: | |
- crates/vsock-proxy/** | |
- shared/** | |
- .github/workflows/vsock-proxy.yml | |
- Cargo.lock | |
name: vsock-proxy | |
jobs: | |
check-proxy: | |
runs-on: ubuntu-latest | |
if: ${{ contains(github.event.release.tag_name, 'vsock-proxy') || github.event_name == 'push' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: 1.79.0 | |
override: true | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "vsock-proxy" | |
- name: Check project | |
run: cargo check -p vsock-proxy | |
- uses: actions-rs/clippy-check@v1 | |
with: | |
args: -p vsock-proxy | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check formatting | |
run: cargo fmt -p vsock-proxy --check | |
test-proxy: | |
runs-on: ubuntu-latest | |
needs: [check-proxy] | |
if: ${{ contains(github.event.release.tag_name, 'vsock-proxy') || github.event_name == 'push' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: 1.79.0 | |
override: true | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "vsock-proxy" | |
- name: Test vsock proxy | |
run: cargo test -p vsock-proxy | |
build-proxy: | |
runs-on: ubuntu-latest | |
needs: [check-proxy,test-proxy] | |
if: ${{ github.event_name == 'push' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: 1.79.0 | |
override: true | |
- name: Compile proxy | |
run: cargo build -p vsock-proxy --release | |
- name: Upload proxy | |
uses: actions/upload-artifact@v2 | |
with: | |
name: vsock-proxy | |
path: target/release/vsock-proxy | |
release-proxy: | |
runs-on: ubuntu-latest | |
needs: [check-proxy,test-proxy] | |
if: ${{ contains(github.event.release.tag_name, 'vsock-proxy') }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: 1.79.0 | |
override: true | |
- name: Publish vsock-proxy | |
run: cargo publish -p vsock-proxy | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} |