-
Notifications
You must be signed in to change notification settings - Fork 2
76 lines (57 loc) · 1.9 KB
/
check_pr.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
name: Test build changed packages on pr
on:
pull_request:
branches:
- main
jobs:
extract_changed_files:
name: Extract files changed in a PR
runs-on: ubuntu-latest
container:
image: ghcr.io/johnthecoolingfan/gentoo-action-image:desktop
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run pkgcheck scan
working-directory: ./repo/games-misc/${{ inputs.package }}
run: pkgcheck scan
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
- name: Filter changed files
id: ebuild-files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "::set-output name=matrix::$(printf '%s\n' "${ALL_CHANGED_FILES[@]}" | grep '\.ebuild$' | jq -R . | jq -sc .)"
test_changed_packages:
name: Test build changed packages
runs-on: ubuntu-latest
needs: extract_changed_files
container:
image: ghcr.io/johnthecoolingfan/gentoo-action-image:desktop
defaults:
run:
shell: bash
strategy:
package: ${{ fromJson(needs.extract_changed_files.outputs.matrix) }}
env:
PACKAGE_FILE: ${{ matrix.package }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install repo
run: |
./.github/workflow-utils/add-repo.sh ./
- name: bash var shenanigans
run: |
echo "PACKAGE_FILENAME=$(basename ${PACKAGE_FILE})" >> $GITHUB_ENV
- name: Install dependencies of the package
run: |
emerge --autounmask y --autounmask-continue y --onlydeps "=games-misc/${PACKAGE_FILENAME#.ebuild}"
- name: Try to build and install (merge) the package
run: |
emerge --autounmask y --autounmask-continue y "=games-misc/${PACKAGE_FILENAME#.ebuild}"