diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml new file mode 100644 index 0000000..7a20c39 --- /dev/null +++ b/.github/workflows/actionlint.yml @@ -0,0 +1,23 @@ +name: actionlint + +permissions: + contents: read + pull-requests: write + +on: + pull_request: + paths: + - '.github/workflows/**' + +jobs: + actionlint: + name: actionlint with reviewdog + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4.1.0 + + - name: actionlint + uses: reviewdog/action-actionlint@v1.40.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + reporter: github-pr-review diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..079b914 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,50 @@ +name: Rust + +on: + push: + branches: [ main ] + pull_request: + +permissions: + id-token: write + contents: read + checks: write + pull-requests: write + +env: + CARGO_INCREMENTAL: 0 + +jobs: + rust: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v4.1.0 + with: + submodules: recursive + + - name: Get Rust toolchain + id: toolchain + run: | + awk -F'[ ="]+' '$1 == "channel" { print "toolchain=" $2 }' rust-toolchain >> "$GITHUB_OUTPUT" + + - uses: dtolnay/rust-toolchain@v1 + with: + toolchain: ${{ steps.toolchain.outputs.toolchain }} + components: clippy, rustfmt + + - name: cache dependencies + uses: Swatinem/rust-cache@v2.7.0 + + - name: reviewdog / clippy + uses: sksat/action-clippy@v0.4.0 + with: + reporter: github-pr-review + + - name: format + run: | + cargo fmt --all -- --check + + - name: unit test + run: | + cargo test diff --git a/.github/workflows/validate-renovate.yml b/.github/workflows/validate-renovate.yml new file mode 100644 index 0000000..ecc82ab --- /dev/null +++ b/.github/workflows/validate-renovate.yml @@ -0,0 +1,22 @@ +name: validate renovate + +on: + pull_request: + paths: + - 'renovate.json' + - '.github/workflows/validate-renovate.yml' + +jobs: + validate-renovate: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v4.1.0 + - uses: actions/setup-node@v4.0.1 + + - name: install + run: | + npm install -g renovate + - name: validate + run: | + renovate-config-validator