forked from webosbrew/apps-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (71 loc) · 2.59 KB
/
app-submissions.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: App Submissions
on:
pull_request:
branches:
- main
paths:
- 'packages/**'
jobs:
app-lint:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Download Homebrew Toolbox
uses: robinraju/[email protected]
with:
repository: "webosbrew/dev-toolbox-cli"
latest: true
fileName: "webosbrew-toolbox-*.deb"
out-file-path: "temp"
- name: Install dependencies
run: |
python3 -m pip install -r ./requirements.txt
sudo apt-get install ./temp/*.deb
- name: Check changed packages
id: changed_files
uses: dorny/paths-filter@v2
with:
list-files: shell
filters: |
packages:
- added|modified: 'packages/**'
- name: Lint package information
id: lint_package
if: ${{ steps.changed_files.outputs.packages == 'true' }}
run: |
export lint_retcode=0
for changed_file in ${{ steps.changed_files.outputs.packages_files }}; do
echo "## Check Results for $(basename ${changed_file}):" >> /tmp/lint-report.md
echo >> /tmp/lint-report.md
echo '### Metadata Lint Result' >> /tmp/lint-report.md
echo >> /tmp/lint-report.md
python3 -m repogen.lintpkg -f "${changed_file}" >> /tmp/lint-report.md || export lint_retcode=1
echo >> /tmp/lint-report.md
ipkfile=/tmp/$(sha256sum "${changed_file}" | cut -d ' ' -f 1).ipk
python3 -m repogen.downloadipk -i "${changed_file}" -o "${ipkfile}"
echo '### Compatibility Check Results' >> /tmp/lint-report.md
python3 -m repogen.check_compat -i "${changed_file}" -p "${ipkfile}" >> /tmp/lint-report.md || export lint_retcode=1
done
exit ${lint_retcode}
- name: Save Issue Number
if: ${{ !env.ACT && (success() || failure()) }}
run: echo $ISSUE_NUMBER > /tmp/issue-number.txt
env:
ISSUE_NUMBER: ${{ github.event.number }}
- name: Upload Check Results
if: ${{ !env.ACT && (success() || failure()) }}
uses: actions/upload-artifact@v3
with:
name: Check Results
path: |
/tmp/lint-report.md
/tmp/issue-number.txt
- name: Print Check Results (Local)
if: ${{ env.ACT && (success() || failure()) }}
run: cat /tmp/lint-report.md