diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..cc58025 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: Build + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + toolchain: [ nightly, stable, 1.77.0 ] + name: [linux, windows, macos] + include: + - name: linux + os: ubuntu-latest + - name: windows + os: windows-latest + - name: macos + os: macos-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: true + + - name: Setup rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: ${{matrix.toolchain}} + + - name: Build all target + run: cargo build --all-targets diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..aab89bd --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,22 @@ +name: Check format + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + format: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: rustfmt + - name: Format + run: cargo fmt -- --check diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..78825b9 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,24 @@ +name: Check lint + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + lint: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: clippy + - name: Lint + run: cargo clippy --all-targets -- -D warnings diff --git a/.github/workflows/checks.yml b/.github/workflows/test.yml similarity index 64% rename from .github/workflows/checks.yml rename to .github/workflows/test.yml index 428e48d..e7d64f9 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Code checks +name: Run tests on: push: @@ -10,30 +10,6 @@ env: CARGO_TERM_COLOR: always jobs: - lint: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - components: clippy - - name: Lint - run: cargo clippy --all-targets -- -D warnings - - format: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v4 - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - components: rustfmt - - name: Format - run: cargo fmt --all -- --check - test_and_coverage: runs-on: ubuntu-latest