-
Notifications
You must be signed in to change notification settings - Fork 3
165 lines (142 loc) · 5.77 KB
/
Copy pathnightly.yml
File metadata and controls
165 lines (142 loc) · 5.77 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Nightly
on:
push:
branches:
- master
paths:
- "packages/**"
workflow_dispatch:
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
outfile: lde-linux-x86-64
- os: ubuntu-22.04-arm
outfile: lde-linux-aarch64
- os: windows-latest
outfile: lde-windows-x86-64.exe
- os: windows-11-arm
outfile: lde-windows-aarch64.exe
- os: macos-15-intel
outfile: lde-macos-x86-64
- os: macos-15
outfile: lde-macos-aarch64
- os: ubuntu-22.04-arm
outfile: lde-android-aarch64
android: true
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Cache llvm-mingw (Windows x86-64)
if: matrix.os == 'windows-latest'
id: cache-llvm-mingw-x64
uses: actions/cache@v5
with:
path: llvm-mingw-20260311-ucrt-x86_64
key: llvm-mingw-20260311-ucrt-x86_64
- name: Setup llvm-mingw (Windows x86-64)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
if ("${{ steps.cache-llvm-mingw-x64.outputs.cache-hit }}" -ne "true") {
curl -L -o llvm-mingw.zip https://github.com/mstorsjo/llvm-mingw/releases/download/20260311/llvm-mingw-20260311-ucrt-x86_64.zip
Expand-Archive -Path llvm-mingw.zip -DestinationPath .
}
echo "$env:GITHUB_WORKSPACE\llvm-mingw-20260311-ucrt-x86_64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Set SEA_CC (Windows x86-64)
if: matrix.os == 'windows-latest'
shell: pwsh
run: echo "SEA_CC=x86_64-w64-mingw32-clang" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Cache llvm-mingw (Windows ARM64)
if: matrix.os == 'windows-11-arm'
id: cache-llvm-mingw-arm64
uses: actions/cache@v5
with:
path: llvm-mingw-20260311-ucrt-aarch64
key: llvm-mingw-20260311-ucrt-aarch64
- name: Setup llvm-mingw (Windows ARM64)
if: matrix.os == 'windows-11-arm'
shell: pwsh
run: |
if ("${{ steps.cache-llvm-mingw-arm64.outputs.cache-hit }}" -ne "true") {
curl -L -o llvm-mingw.zip https://github.com/mstorsjo/llvm-mingw/releases/download/20260311/llvm-mingw-20260311-ucrt-aarch64.zip
Expand-Archive -Path llvm-mingw.zip -DestinationPath .
}
echo "$env:GITHUB_WORKSPACE\llvm-mingw-20260311-ucrt-aarch64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Set SEA_CC (Windows ARM64)
if: matrix.os == 'windows-11-arm'
shell: pwsh
run: echo "SEA_CC=aarch64-w64-mingw32-clang" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- uses: lde-org/setup-lde@master
with:
version: nightly
platform: ${{ matrix.android && 'Android' || '' }}
- name: Cache curl-sys build
uses: actions/cache@v5
with:
path: packages/*/target/curl-sys
key: curl-sys-${{ matrix.os }}-${{ runner.arch }}${{ matrix.android && '-android' || '' }}
- name: Cache deflate-sys build
uses: actions/cache@v5
with:
path: packages/*/target/deflate-sys
key: deflate-sys-${{ matrix.os }}-${{ runner.arch }}${{ matrix.android && '-android' || '' }}
- name: Cache git2-sys build
uses: actions/cache@v5
with:
path: packages/*/target/git2-sys
key: git2-sys-${{ matrix.os }}-${{ runner.arch }}${{ matrix.android && '-android' || '' }}
- name: Build lde
if: "!matrix.android"
run: |
cd packages/lde
lde compile --outfile ${{ matrix.outfile }}
- name: Run tests
if: "!matrix.android"
run: ./packages/lde/${{ matrix.outfile }} test
- name: Fix workspace permissions (Android)
if: matrix.android
run: |
chmod -R a+rw ${{ github.workspace }}
cp ~/.lde/lde ${{ github.workspace }}/lde
- name: Cache test image (Android)
if: matrix.android
id: cache-android-image
uses: actions/cache@v5
with:
path: /tmp/termux-android.tar
key: termux-android-v3
- name: Run tests (Android)
if: matrix.android
run: |
if [[ "${{ steps.cache-android-image.outputs.cache-hit }}" != "true" ]]; then
docker run --privileged --platform linux/arm64 \
--name termux-build termux/termux-docker:aarch64 \
bash -c "apt update && apt install -y clang cmake ninja openssl"
docker commit termux-build termux-android:latest
docker rm termux-build
docker save termux-android:latest -o /tmp/termux-android.tar
fi
docker load -i /tmp/termux-android.tar
docker run --rm --privileged --platform linux/arm64 \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
termux-android:latest \
bash -c "/workspace/lde --setup && cd /workspace/packages/lde && /workspace/lde compile --outfile /workspace/packages/lde/${{ matrix.outfile }} && cd /workspace && /workspace/packages/lde/${{ matrix.outfile }} test"
- name: Upload nightly release asset
uses: softprops/action-gh-release@v3
with:
tag_name: nightly
name: Nightly Build
prerelease: true
body: |
Automated nightly build from master.
Commit: ${{ github.sha }}
Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
files: packages/lde/${{ matrix.outfile }}
fail_on_unmatched_files: true