From cb619b5b0402523531172311b16c245c78469d76 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Mon, 22 Jul 2024 14:26:30 +0200 Subject: [PATCH] github: Add CI for verifying sensitive_pn.xml Change-Id: I701b579896f8021b6cdfbe6ad89d60710d2d9591 --- .github/workflows/build/action.yml | 13 ++++++++++ .github/workflows/gerrit.yml | 38 ++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/workflows/build/action.yml create mode 100644 .github/workflows/gerrit.yml diff --git a/.github/workflows/build/action.yml b/.github/workflows/build/action.yml new file mode 100644 index 0000000000..b808aa0bd2 --- /dev/null +++ b/.github/workflows/build/action.yml @@ -0,0 +1,13 @@ +name: build + +runs: + using: composite + + steps: + - name: Install dependencies + shell: bash + run: sudo apt -y install libxml2-utils + + - name: Validate sensitive_pn.xml + shell: bash + run: xmllint --noout --schema ./spn/SpnInfo.xsd ./prebuilt/common/etc/sensitive_pn.xml diff --git a/.github/workflows/gerrit.yml b/.github/workflows/gerrit.yml new file mode 100644 index 0000000000..906027a865 --- /dev/null +++ b/.github/workflows/gerrit.yml @@ -0,0 +1,38 @@ +name: gerrit checks + +on: + workflow_dispatch: + inputs: + ref: + type: string + gerrit-ref: + type: string + change: + type: string + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: lineageos-infra/fetch-gerrit-change@main + with: + gerrit-ref: ${{ inputs.gerrit-ref }} + ref: ${{ inputs.ref }} + + - name: Check if build/action.yml exists + id: check + run: | + if [ -f ./.github/workflows/build/action.yml ]; then + echo "run=1" >> "$GITHUB_OUTPUT" + fi + + - name: Build + if: ${{ steps.check.outputs.run }} + uses: ./.github/workflows/build + + - uses: lineageos-infra/gerrit-vote@main + if: ${{ steps.check.outputs.run && always() }} + with: + auth: ${{ secrets.GERRIT_VOTE_CREDS }} + change: ${{ inputs.change }} + ref: ${{ inputs.ref }}