Skip to content

Commit

Permalink
add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Leechael committed Oct 16, 2024
1 parent ee574c0 commit ddb76a4
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with debug logging enabled'
required: false
default: false

jobs:
build:
name: Build and Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [stable]

steps:
- uses: actions/checkout@v2

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose

- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Debug log
if: ${{ github.event.inputs.debug_enabled == 'true' }}
run: |
echo "Debug logging enabled"
# 在这里添加您想要的任何额外的调试命令
cargo --version
rustc --version

0 comments on commit ddb76a4

Please sign in to comment.