redpill-tool-chain/.github/workflows/test.yml

104 lines
3.5 KiB
YAML
Raw Normal View History

2021-10-13 18:52:31 +00:00
name: 测试构建
2021-10-23 20:01:29 +00:00
2022-02-21 08:58:16 +00:00
on:
2022-02-21 09:05:08 +00:00
push:
2022-02-21 13:28:57 +00:00
branches: [ master ]
2021-10-23 20:01:29 +00:00
2021-10-13 18:52:31 +00:00
jobs:
build:
runs-on: ubuntu-latest
name: 编译 "${{matrix.platform}} ${{matrix.version}}"
strategy:
fail-fast: false
matrix:
include:
2022-02-21 13:35:29 +00:00
# 两行一组,删除不需要的版本
2022-03-10 20:26:00 +00:00
- platform: ds3615xs
2021-10-13 18:52:31 +00:00
version: 6.2.4-25556
2022-03-10 20:26:00 +00:00
- platform: ds3615xs
2021-10-13 18:52:31 +00:00
version: 7.0-41222
2022-03-10 20:26:00 +00:00
- platform: ds3615xs
2021-10-13 18:52:31 +00:00
version: 7.0.1-42218
2022-03-10 20:26:00 +00:00
- platform: ds918p
2021-10-13 18:52:31 +00:00
version: 6.2.4-25556
2022-03-10 20:26:00 +00:00
- platform: ds918p
2021-10-13 18:52:31 +00:00
version: 7.0-41890
2022-03-10 20:26:00 +00:00
- platform: ds918p
2021-10-13 18:52:31 +00:00
version: 7.0.1-42218
2022-03-10 20:26:00 +00:00
- platform: ds3617xs
2022-02-21 08:58:16 +00:00
version: 7.0.1-42218
2022-03-10 20:26:00 +00:00
- platform: ds3622xsp
2022-02-21 08:19:57 +00:00
version: 7.0.1-42218
2022-03-10 20:26:00 +00:00
- platform: ds920p
2022-02-23 11:58:47 +00:00
version: 7.0.1-42218
2022-03-10 21:27:01 +00:00
- platform: ds1621p
version: 7.0.1-42218
2022-02-21 13:28:57 +00:00
2021-10-13 18:52:31 +00:00
steps:
2022-02-21 08:19:57 +00:00
- name: 检出项目文件
2021-10-13 18:52:31 +00:00
uses: actions/checkout@v2
- name: 缓存加速
uses: actions/cache@v2
with:
path: |
cache/*.pat
docker/downloads/*.txz
key: ${{matrix.platform}}-${{matrix.version}}-${{ hashFiles('global_config.json') }}
- name: 准备构建环境
run: |
./redpill_tool_chain.sh build ${{matrix.platform}}-${{matrix.version}}
- name: 配置引导镜像
run: |
2022-03-10 21:16:05 +00:00
cp sample_user_config.json ${{matrix.platform}}_user_config.json
2022-03-04 07:40:42 +00:00
2022-02-21 08:58:16 +00:00
# 调整VID和PID
sed -i -e 's\0x0001\0x0002\g' -e 's\0x46f4\0x0002\g' ${{matrix.platform}}_user_config.json
2022-03-04 07:40:42 +00:00
2022-02-21 13:35:29 +00:00
# 调整SN和MAC 最好使用 actions secrets 引入
2022-02-21 08:58:16 +00:00
sed -i -e 's\1234XXX123\0123456789\g' -e 's\XXYYXXYYXXYY\00AAAAAAAAAA\g' ${{matrix.platform}}_user_config.json
2022-03-04 07:40:42 +00:00
2022-02-21 09:12:23 +00:00
# 添加第二张网卡mac并设置网卡数量
sed -i -e 's/00AAAAAAAAAA"/&,\n\t"mac2": "00BBBBBBBBBB",\n\t"netif_num": 2/' ${{matrix.platform}}_user_config.json
2022-03-04 07:40:42 +00:00
2022-02-21 09:12:23 +00:00
# 调整synoinfo
sed -i -e 's/"synoinfo": {},/"synoinfo": {\n\t"maxlanport": "2"\n },/' ${{matrix.platform}}_user_config.json
2022-03-04 07:40:42 +00:00
2022-02-21 09:24:05 +00:00
# 添加扩展驱动
2022-02-21 08:58:16 +00:00
./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/rpext-index.json
2021-10-23 20:40:40 +00:00
./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/rpext-index.json
2022-03-04 07:59:46 +00:00
- name: 添加 jumkey.misc
if: endsWith(matrix.version,'42218')
run: |
2022-03-04 08:14:12 +00:00
./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/rpext-index.json
2022-03-04 07:59:46 +00:00
2022-03-04 08:36:30 +00:00
- name: 添加 jumkey.dtb !!!Create your own device tree binary!!!
2022-03-10 21:16:05 +00:00
if: matrix.platform == 'ds920p' || matrix.platform == 'ds1621p'
2022-03-04 07:59:46 +00:00
run: |
./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-dtb/rpext-index.json
2022-03-04 08:36:30 +00:00
echo '!!!Create your own device tree binary!!!'
2022-03-04 07:59:46 +00:00
echo 'see https://github.com/jumkey/redpill-load/blob/develop/redpill-dtb/README.md'
2021-10-13 18:52:31 +00:00
- name: 编译引导镜像
run: ./redpill_tool_chain.sh auto ${{matrix.platform}}-${{matrix.version}}
- name: 上传引导镜像到 github actions
uses: actions/upload-artifact@v2
with:
2021-10-23 20:01:29 +00:00
name: dsm-${{matrix.platform}}-${{matrix.version}}
2021-10-13 18:52:31 +00:00
path: images/redpill-DS[39]*.img
if-no-files-found: error
2022-02-21 08:25:38 +00:00
- name: 删除旧的工作流
2022-02-21 08:58:16 +00:00
uses: Mattraks/delete-workflow-runs@v2
2022-02-21 08:25:38 +00:00
with:
2022-02-21 08:58:16 +00:00
token: ${{ github.token }}
repository: ${{ github.repository }}
2022-02-21 13:28:57 +00:00
retain_days: 3
keep_minimum_runs: 6
2021-10-13 18:52:31 +00:00