-
Notifications
You must be signed in to change notification settings - Fork 468
69 lines (58 loc) · 1.8 KB
/
build-test.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
name: Build Test
on:
push:
branches-ignore:
- "releases/v*"
tags-ignore:
- "*"
pull_request:
jobs:
build:
runs-on: ubuntu-latest
env:
SDK_URL_PATH: https://downloads.openwrt.org/snapshots/targets/x86/64
SDK_NAME: -sdk-x86-64_
ARCH: x86_64
CACHE_DIR: ~/cache
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Cache
uses: actions/cache@v2
with:
path: ${{ env.CACHE_DIR }}
key: ${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:cache:${{ github.run_number }}
restore-keys: |
${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:cache:
- name: Setup CCache
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:ccache:${{ github.run_number }}
restore-keys: |
${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:ccache:
- name: Install Dependencies
run: |
sudo apt-get update && \
sudo apt-get install -yq gettext libncurses5-dev rsync xsltproc
- name: Prepare For Build
run: |
sdk_home="$(mktemp -d)"
test -d ~/.ccache || mkdir -p ~/.ccache
ln -sf ~/.ccache "$sdk_home/.ccache"
echo "SDK_HOME=$sdk_home" >> $GITHUB_ENV
echo "CONFIG_CCACHE=y" >> $GITHUB_ENV
- name: Build package
env:
OPENWRT_GOLANG_COMMIT: ${{ secrets.OPENWRT_GOLANG_COMMIT }}
run: sh compile.sh
- name: Show CCache Status
run: |
eval "${{ env.SDK_HOME }}/staging_dir/host/bin/ccache -s"
- name: Save Build Result
uses: actions/upload-artifact@v2
with:
name: v2ray-core
path: |
*.ipk
retention-days: 7