diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..c794eae --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @azenla diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..332a46a --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,24 @@ +version: 2 +updates: +- package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + groups: + actions-updates: + dependency-type: production + applies-to: version-updates + actions-dev-updates: + dependency-type: development + applies-to: version-updates +- package-ecosystem: cargo + directory: / + schedule: + interval: weekly + groups: + cargo-updates: + dependency-type: production + applies-to: version-updates + cargo-dev-updates: + dependency-type: development + applies-to: version-updates diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml new file mode 100644 index 0000000..0f95dfa --- /dev/null +++ b/.github/workflows/check.yaml @@ -0,0 +1,97 @@ +name: check + +on: + pull_request: + branches: + - main + push: + branches: + - main + +permissions: + contents: read + +jobs: + rustfmt: + name: rustfmt + runs-on: ubuntu-latest + steps: + - name: harden runner + uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1 + with: + egress-policy: audit + + - name: checkout + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + with: + persist-credentials: false + + - name: 'install nightly rust toolchain with rustfmt' + run: | + rustup update --no-self-update nightly + rustup default nightly + rustup component add rustfmt + + - name: 'cargo fmt' + run: cargo fmt --all -- --check + + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + arch: + - x86_64 + - aarch64 + env: + TARGET_ARCH: "${{ matrix.arch }}" + name: 'build ${{ matrix.arch }}' + steps: + - name: harden runner + uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1 + with: + egress-policy: audit + + - name: checkout + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + with: + persist-credentials: false + + - name: 'install nightly rust toolchain' + run: | + rustup update --no-self-update nightly + rustup default nightly + + - name: cargo build + run: cargo build --target "${TARGET_ARCH}-unknown-uefi" + + clippy: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + arch: + - x86_64 + - aarch64 + env: + TARGET_ARCH: "${{ matrix.arch }}" + name: 'clippy ${{ matrix.arch }}' + steps: + - name: harden runner + uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1 + with: + egress-policy: audit + + - name: checkout + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + with: + persist-credentials: false + + - name: 'install nightly rust toolchain with clippy' + run: | + rustup update --no-self-update nightly + rustup default stable + rustup component add clippy + + - name: cargo clippy + run: cargo clippy --target "${TARGET_ARCH}-unknown-uefi" diff --git a/.github/workflows/zizmor.yaml b/.github/workflows/zizmor.yaml new file mode 100644 index 0000000..9368e17 --- /dev/null +++ b/.github/workflows/zizmor.yaml @@ -0,0 +1,43 @@ +name: zizmor + +on: + push: + branches: ["main"] + pull_request: + branches: ["**"] + +permissions: + contents: read + +jobs: + zizmor: + name: zizmor + runs-on: ubuntu-latest + permissions: + security-events: write + contents: read + actions: read + steps: + - name: harden runner + uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1 + with: + egress-policy: audit + + - name: checkout + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + with: + persist-credentials: false + + - name: setup uv + uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7 + + - name: zizmor + run: uvx zizmor --pedantic --format sarif . > results.sarif + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: upload + uses: github/codeql-action/upload-sarif@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # v4 + with: + sarif_file: results.sarif + category: zizmor