diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 097b1ff..9916128 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -1,5 +1,6 @@ # yaml-language-server: $schema=https://json.schemastore.org/github-workflow +# Same as file name name: pre-commit permissions: @@ -10,14 +11,15 @@ on: push: branches: - "*" + workflow_dispatch: env: CARGO_TERM_COLOR: always jobs: - pre-commit: - name: Detecting code style issues + run: runs-on: ubuntu-latest + steps: - name: Install ALSA and Jack dependencies run: sudo apt install alsa libasound2-dev libxcb-shape0-dev libxcb-xfixes0-dev @@ -41,8 +43,8 @@ jobs: - name: Cache Rust toolchain and build artifacts uses: Swatinem/rust-cache@v2 with: - # Distinguished by the action name to avoid sharing across different actions! - shared-key: "pre-commit" + # The cache should not be shared between different workflows and jobs. + shared-key: ${{ github.workflow }}-${{ github.job }} - name: Detect code style issues (push) uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/ci.yaml b/.github/workflows/test.yaml similarity index 60% rename from .github/workflows/ci.yaml rename to .github/workflows/test.yaml index e1ddc92..87d41f2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/test.yaml @@ -1,25 +1,34 @@ -name: Rust CI +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow + +# Same as file name +name: test + +permissions: + contents: read on: pull_request: push: branches: - main + workflow_dispatch: jobs: - build_and_test: - name: Build and test + run: + runs-on: ${{ matrix.os }} + strategy: matrix: include: - os: ubuntu-latest rust: stable + workspace-extra-args: "" # Minimum Supported Rust Version (MSRV) - os: ubuntu-latest rust: 1.62.0 + workspace-extra-args: "--exclude player --exclude writer" - runs-on: ${{ matrix.os }} steps: - name: Install dependencies run: sudo apt install alsa libasound2-dev libxcb-shape0-dev libxcb-xfixes0-dev @@ -39,15 +48,8 @@ jobs: - name: Cache Rust toolchain and build artifacts uses: Swatinem/rust-cache@v2 with: - # Distinguished by the action name to avoid sharing! - # The cache is automatically keyed by the relevant matrix properties. - shared-key: "ci" - - - name: Check workspace build - run: cargo check --locked --workspace --tests --features decode-all - - - name: Build tests - run: cargo test --locked --all-targets --no-run + # The cache should not be shared between different workflows and jobs. + shared-key: ${{ github.workflow }}-${{ github.job }} - - name: Run tests - run: cargo test --locked --all-targets -- --nocapture --quiet + - name: Run workspace tests + run: cargo test --locked --workspace --features decode-all ${{ matrix.workspace-extra-args }} -- --nocapture --quiet diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6ab0a42..4a74f08 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - repo: https://github.com/DavidAnson/markdownlint-cli2 - rev: v0.8.1 + rev: v0.9.2 hooks: - id: markdownlint-cli2 exclude: ^LICENSE\.md$ @@ -36,12 +36,12 @@ repos: - id: codespell args: [--ignore-words=.codespellignore] - repo: https://github.com/sirosen/check-jsonschema - rev: 0.23.2 + rev: 0.26.3 hooks: - id: check-github-actions - id: check-github-workflows - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.0 + rev: v3.0.2 hooks: - id: prettier types_or: