-
Notifications
You must be signed in to change notification settings - Fork 253
Expand file tree
/
Copy pathAuto compilation testing v2.yml
More file actions
80 lines (69 loc) · 2.29 KB
/
Auto compilation testing v2.yml
File metadata and controls
80 lines (69 loc) · 2.29 KB
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
#
# Copyright (c) 2023-2026 SMALLPROGRAM <https://github.com/smallprogram>
# Description: Automated compilation testing (Powered by Official OpenWrt SDK - Snapshot)
#
name: Auto compilation testing v2
on:
#push:
# branches:
# - main
# paths-ignore:
# - '**.md'
# - '.github/**'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
- '.github/**'
env:
TZ: Asia/Shanghai
jobs:
job_auto_compile:
runs-on: ubuntu-latest
name: Build ${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
# 这些架构我感觉应该可以覆盖了全部主流指令集:包含 x86, ARM64, ARM32, MIPS (LE), MIPS (BE)。
arch:
- x86-64
- rockchip-armv8
- sunxi-cortexa7
- ramips-rt288x
- ath79-generic
- ipq806x-generic
steps:
- name: Checkout code
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Detect Changed Packages
id: detect-changes
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
BASE_SHA=$(git merge-base refs/remotes/origin/${{ github.base_ref }} ${{ github.event.pull_request.head.sha }})
HEAD_SHA=${{ github.event.pull_request.head.sha }}
echo "Detected PR event."
else
BASE_SHA=${{ github.event.before }}
HEAD_SHA=${{ github.event.after }}
echo "Detected Push event."
fi
CHANGED_PKGS=$(git diff --name-only $BASE_SHA $HEAD_SHA | awk -F'/' '{print $1}' | sort -u | grep -v '^\.' | tr '\n' ' ')
echo "Changed packages: $CHANGED_PKGS"
if [ -z "$(echo $CHANGED_PKGS | tr -d ' ')" ]; then
echo "SKIP_BUILD=true" >> $GITHUB_ENV
echo "No package changes detected, skipping build."
else
echo "SKIP_BUILD=false" >> $GITHUB_ENV
echo "PACKAGES=$CHANGED_PKGS" >> $GITHUB_ENV
fi
- name: Build packages with Official OpenWrt SDK
if: env.SKIP_BUILD == 'false'
uses: openwrt/gh-action-sdk@main
env:
ARCH: ${{ matrix.arch }}-snapshot
FEEDNAME: passwall_packages
PACKAGES: ${{ env.PACKAGES }}
V: s