diff --git a/.github/workflows/PR-Verification.yml b/.github/workflows/PR-Verification.yml deleted file mode 100644 index 8201535..0000000 --- a/.github/workflows/PR-Verification.yml +++ /dev/null @@ -1,77 +0,0 @@ -# name: PR Verification - -# on: -# pull_request_review: -# types: -# - submitted - -# jobs: -# test-win64: -# runs-on: windows-latest -# steps: -# - name: Check if PR has been approved -# id: check_approval -# if: github.event.review.state == 'approved' -# run: | -# echo "::set-output name=approved::1" - -# - name: Checkout Repository -# uses: actions/checkout@v4 -# with: -# submodules: true -# fetch-depth: 0 -# token: ${{ secrets.QUANTUMIX_TOKEN }} - -# - name: Update local toolchain -# run: | -# rustup update - -# - name: Toolchain info -# run: | -# cargo --version --verbose -# rustc --version - -# - name: Lint Code -# run: | -# cargo fmt -- --check - -# - name: Test Project -# if: steps.check_approval.outputs.approved == '1' -# run: | -# cargo check -# cargo test --all - -# test-linux: -# runs-on: ubuntu-latest -# steps: -# - name: Check if PR has been approved -# id: check_approval -# if: github.event.review.state == 'approved' -# run: | -# echo "::set-output name=approved::1" - -# - name: Checkout Repository -# uses: actions/checkout@v4 -# with: -# submodules: true -# fetch-depth: 0 -# token: ${{ secrets.QUANTUMIX_TOKEN }} - -# - name: Update local toolchain -# run: | -# rustup update - -# - name: Toolchain info -# run: | -# cargo --version --verbose -# rustc --version - -# - name: Lint Code -# run: | -# cargo fmt -- --check - -# - name: Test Project -# if: steps.check_approval.outputs.approved == '1' -# run: | -# cargo check -# cargo test --all diff --git a/.github/workflows/Push-Build.yml b/.github/workflows/Push-Build.yml deleted file mode 100644 index f8f364d..0000000 --- a/.github/workflows/Push-Build.yml +++ /dev/null @@ -1,91 +0,0 @@ -# name: Push Buld - -# on: -# push: -# branches: ["main", "dev"] - -# env: -# CARGO_TERM_COLOR: always - -# jobs: -# build-win64-debug: -# runs-on: windows-latest -# if: github.event.repository.fork == false -# steps: -# - name: Checkout Repository -# uses: actions/checkout@v4 -# with: -# submodules: true -# fetch-depth: 0 -# token: ${{ secrets.QUANTUMIX_TOKEN }} - -# - name: Update local toolchain -# run: | -# rustup update - -# - name: Toolchain info -# run: | -# cargo --version --verbose -# rustc --version - -# - name: Lint Code -# run: | -# cd . -# cargo fmt -- --check - -# - name: Test Project -# run: | -# cargo check -# cargo test --all - -# - name: Build Quantumix-Server -# run: | -# cargo build -# dir target/debug - -# - name: Package and Upload -# uses: actions/upload-artifact@v3 -# with: -# name: Quantumix-Server-Win64-Debug-${{ github.sha }} -# path: ./target/debug/quantumix-server.exe - -# build-linux-debug: -# runs-on: ubuntu-latest -# if: github.event.repository.fork == false -# steps: -# - name: Checkout Repository -# uses: actions/checkout@v4 -# with: -# submodules: true -# fetch-depth: 0 -# token: ${{ secrets.QUANTUMIX_TOKEN }} - -# - name: Update local toolchain -# run: | -# rustup update - -# - name: Toolchain info -# run: | -# cargo --version --verbose -# rustc --version - -# - name: Lint Code -# run: | -# cd . -# ls -# cargo fmt -- --check - -# - name: Test Project -# run: | -# cargo check -# cargo test --all - -# - name: Build Quantumix-Server -# run: | -# cargo build - -# - name: Package and Upload -# uses: actions/upload-artifact@v3 -# with: -# name: Quantumix-Server-Linux-Debug-${{ github.sha }} -# path: ./target/debug/quantumix-server diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml new file mode 100644 index 0000000..e870839 --- /dev/null +++ b/.github/workflows/audit.yml @@ -0,0 +1,41 @@ +name: Audit + +on: + schedule: + - cron: "0 0 * * *" + push: + branches: + - main + paths: + - ".github/workflows/audit.yml" + - "**/Cargo.lock" + - "**/Cargo.toml" + pull_request: + branches: + - main + paths: + - ".github/workflows/audit.yml" + - "**/Cargo.lock" + - "**/Cargo.toml" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + audit: + strategy: + fail-fast: false + matrix: + workspace: [server, src-tauri] + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - uses: actions-rust-lang/audit@v1 + with: + TOKEN: ${{ secrets.GITHUB_TOKEN }} + workingDirectory: ${{ matrix.workspace }} diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml new file mode 100644 index 0000000..01b2d48 --- /dev/null +++ b/.github/workflows/clippy.yml @@ -0,0 +1,52 @@ +name: Check + +on: + push: + branches: + - main + paths: + - ".github/workflows/check.yml" + - "**/*.rs" + - "**/Cargo.toml" + pull_request: + branches: + - main + paths: + - ".github/workflows/check.yml" + - "**/*.rs" + - "**/Cargo.toml" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + fmt: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + - run: cargo fmt --all -- --check + + clippy: + strategy: + fail-fast: false + matrix: + platform: [ubuntu-latest, macos-latest, windows-latest] + + runs-on: ${{ matrix.platform }} + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy + - uses: Swatinem/rust-cache@v2 + - run: cd server && cargo clippy --all-targets --all-features diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..195a369 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,30 @@ +name: Test Server + +on: + push: + branches: + - main + pull_request: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + strategy: + fail-fast: false + matrix: + platform: [ubuntu-latest, macos-latest, windows-latest] + + runs-on: ${{ matrix.platform }} + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - run: cd server && cargo test --all-targets --all-features