feat(ci): Add lint and try dnf in in autobuild

This also renames some workflows.
This commit is contained in:
windowsboy111
2023-06-19 13:04:26 +08:00
parent b99d89631c
commit c5cf98ae36
5 changed files with 70 additions and 4 deletions
+66
View File
@@ -83,3 +83,69 @@ jobs:
- name: Notify Madoguchi (Failure)
if: ( cancelled() || failure() ) && github.event_name == 'push'
run: ./.github/workflows/mg.sh false ${{matrix.pkg.pkg}} ${{matrix.version}} ${{matrix.pkg.arch}} ${{github.run_id}} ${{secrets.MADOGUCHI_JWT}}
- name: Lint RPMs and SRPMs
id: lint
if: success()
run: |
rpmlint anda-build/ > rpmlint.txt || true
if [[ $? -ne 0 ]]; then
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "lint_out<<$EOF" >> $GITHUB_ENV
cat rpmlint.txt >> $GITHUB_ENV
echo $EOF >> $GITHUB_ENV
fi
- name: Try to install package
id: dnf
if: success()
run: |
x=""
for f in anda-build/rpm/rpms/*.rpm; do
dnf in --downloadonly $f > "$f.dnfout.txt"
if [[ $? -ne 0 ]]; then
x="$x### $f\n```\n$(cat $f.dnfout.txt)```\n"
fi
done
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "dnf_out<<$EOF\n$x\n$EOF" >> $GITHUB_ENV
- name: Comment RPMLint/DNF output (PR)
if: success() && github.event_name == 'pull_request'
uses: actions/github-script@v6
with:
script: |
let out = "";
if ("${{ env.lint_out }}".trim() != "") {
out += "## 🔨 Lint: [${{matrix.pkg.pkg}} (${{matrix.pkg.arch}})](https://github.com/terrapkg/packages/actions/runs/${{github.run_id}})\n";
out += "```\n${{ env.lint_out }}```\n";
}
if ("${{ env.dnf_out }}".trim() != "") {
out += "## ❌ DNF: [${{matrix.pkg.pkg}} (${{matrix.pkg.arch}})](https://github.com/terrapkg/packages/actions/runs/${{github.run_id}})\n${{ env.dnf_out }}\n";
}
if (out != "") {
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: out,
});
}
- name: Create commit comment
if: success() && github.event_name != 'pull_request'
uses: peter-evans/commit-comment@v1
with:
body: |
<sub>[run_id: ${{github.run_id}}](https://github.com/terrapkg/packages/actions/runs/${{github.run_id}})</sub>
# Built RPM: ${{matrix.pkg.pkg}} (${{matrix.pkg.arch}}.fc${{matrix.version}})
## Lint
If you see anything below, RPMLint returned with a non-zero exit code.
${{ env.lint_out }}
## DNF
Output of `dnf in --downloadonly ...`.
If you see anything below, DNF returned with a non-zero exit code.
${{ env.dnf_out }}
+1 -1
View File
@@ -1,4 +1,4 @@
name: Build Packages
name: Manual Builds
on:
workflow_dispatch:
inputs:
+1 -1
View File
@@ -1,4 +1,4 @@
name: Build Packages (JSON)
name: JSON Build
on:
workflow_dispatch:
inputs:
+1 -1
View File
@@ -1,4 +1,4 @@
name: Automatic Nightly Update
name: Nightly Update
on:
schedule:
- cron: "0 0 * * *"
+1 -1
View File
@@ -1,4 +1,4 @@
name: Automatically check for updates
name: Update
on:
schedule:
- cron: "*/30 * * * *"