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

feat: handle multiple devices #6

Merged
merged 16 commits into from
Aug 31, 2024
13 changes: 4 additions & 9 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
[source.crates-io]
replace-with = 'rsproxy-sparse'
[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"
[source.rsproxy-sparse]
registry = "sparse+https://rsproxy.cn/index/"
[registries.rsproxy]
index = "https://rsproxy.cn/crates.io-index"
[net]
git-fetch-with-cli = true

Expand All @@ -19,4 +11,7 @@ rustflags = [
"-C", "link-arg=Ole32.lib",
"-C", "link-arg=User32.lib",
"-C", "link-arg=msvcrtd.lib"
]
]

[env]
RUST_LOG="info"
8 changes: 8 additions & 0 deletions .github/workflows/build-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- name: Install vcpkg build dependencies
run: sudo apt-get --assume-yes install nasm

- name: Install vcpkg
run: cargo install cargo-vcpkg

- name: Build vcpkg dependencies
run: cargo vcpkg --verbose build
26 changes: 26 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Continuous Deployment

on:
push:
branches:
- main

jobs:
release-plz:
name: Release-plz
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_PLZ_TOKEN }}

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Run release-plz
uses: MarcoIeni/release-plz-action@v0.5
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
71 changes: 41 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,41 @@
name: Cargo Build & Test

on:
push:
pull_request:

env:
CARGO_TERM_COLOR: always

# TODO: setup versioning and relase with knope
jobs:
build_and_test:
name: Rust project - latest
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v3
- name: install rust
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} && rustup component add rustfmt
- name: Install vcpkg build deps
run: sudo apt-get --assume-yes install nasm
- run: cargo install cargo-vcpkg
- run: cargo vcpkg --verbose build
- run: cargo build --verbose
- run: cargo test --verbose
name: Cargo Build & Test

on:
push:
branches:
- "*"

env:
CARGO_TERM_COLOR: always

jobs:
test:
name: Test
runs-on: ubuntu-latest
# Run only on pushes to branches with open PRs
if: github.event_name == 'push' && contains(fromJson('["refs/heads/main"]'), github.ref) == false && github.event.repository.pulls != '[]'
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v3
- name: Install rust
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} && rustup component add rustfmt

- name: Install vcpkg build dependencies
run: sudo apt-get --assume-yes install nasm

- name: Install vcpkg
run: cargo install cargo-vcpkg

- name: Build vcpkg dependencies
run: cargo vcpkg --verbose build

- name: Build
run: cargo build --verbose

- name: Run tests
run: cargo test --verbose
Loading
Loading