Skip to content

Commit e30b59d

Browse files
committed
Merge branch 'master' of github.com:CppCXY/lua-language-server
2 parents ab2f9a7 + 3886d2e commit e30b59d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+6318
-4699
lines changed

.github/scripts/check-changelog.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
CHANGELOG_FILE="changelog.md"
6+
7+
git fetch origin $GITHUB_BASE_REF
8+
git fetch
9+
10+
# Check if the changelog file was modified in the PR
11+
if git diff --name-only origin/$GITHUB_BASE_REF..remotes/pull/$GITHUB_SOURCE_REF | grep -q $CHANGELOG_FILE; then
12+
echo "Thank you for updating the changelog!"
13+
exit 0
14+
else
15+
echo "Changelog has not been updated. Please update $CHANGELOG_FILE!"
16+
exit 1
17+
fi

.github/workflows/build.yml

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
push:
88
branches:
99
- master
10+
- 'v*.*.*'
1011
tags:
1112
- "*"
1213
pull_request:
@@ -24,8 +25,8 @@ jobs:
2425
matrix:
2526
include:
2627
- { os: ubuntu-22.04, target: linux, platform: linux-x64, container: 'alpine:latest', libc: musl }
27-
- { os: ubuntu-20.04, target: linux, platform: linux-x64, container: 'ubuntu:18.04' }
28-
- { os: ubuntu-20.04, target: linux, platform: linux-arm64, container: 'ubuntu:18.04' }
28+
- { os: ubuntu-20.04, target: linux, platform: linux-x64 }
29+
- { os: ubuntu-20.04, target: linux, platform: linux-arm64 }
2930
- { os: macos-11, target: darwin, platform: darwin-x64 }
3031
- { os: macos-11, target: darwin, platform: darwin-arm64 }
3132
- { os: windows-latest, target: windows, platform: win32-ia32 }
@@ -34,49 +35,48 @@ jobs:
3435
container:
3536
image: ${{ matrix.container }}
3637
steps:
37-
- name: Prepare container
38-
if: ${{ matrix.target == 'linux' && matrix.libc != 'musl' }}
39-
run: |
40-
apt-get update
41-
apt-get install -y software-properties-common
42-
add-apt-repository -y ppa:ubuntu-toolchain-r/test # For gcc-9 and g++-9
43-
add-apt-repository -y ppa:git-core/ppa # For git>=2.18.
44-
apt-get update
45-
apt-get install -y sudo git gcc-9 g++-9
46-
4738
- name: Install aarch64-linux-gnu
4839
if: ${{ matrix.platform == 'linux-arm64' && matrix.libc != 'musl' }}
4940
run: |
50-
apt-get update
51-
apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
52-
53-
- name: Prepare container env
54-
if: ${{ matrix.target == 'linux' && matrix.libc != 'musl' }}
55-
run: |
56-
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100
57-
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 100
41+
sudo apt-get update
42+
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
5843
5944
- name: Prepare container for musl
6045
if: ${{ matrix.target == 'linux' && matrix.libc == 'musl' }}
6146
run: |
6247
apk update
6348
apk add git ninja bash build-base nodejs linux-headers
6449
65-
- uses: actions/checkout@v3
50+
- name: Prepare for Linux
51+
if: ${{ matrix.target == 'linux' && matrix.libc != 'musl' }}
52+
run: |
53+
sudo apt update
54+
sudo apt install ninja-build
55+
56+
- uses: actions/checkout@v4
6657
with:
6758
submodules: recursive
6859

69-
- name: Build for others step-1
70-
if: ${{ matrix.libc != 'musl' }}
71-
uses: actboy168/setup-luamake@master
60+
- name: Build for Windows
61+
if: ${{ matrix.target == 'windows' }}
62+
run: .\make.bat ${{ matrix.platform }}
7263

73-
- name: Build for others step-2
74-
if: ${{ matrix.libc != 'musl' }}
75-
run: luamake -platform ${{ matrix.platform }}
64+
- name: Build for Linux
65+
if: ${{ matrix.target == 'linux' }}
66+
run: |
67+
./make.sh ${{ matrix.platform }}
68+
69+
- name: Build for macOS
70+
if: ${{ matrix.target == 'darwin' }}
71+
run: |
72+
brew install ninja
73+
./make.sh ${{ matrix.platform }}
7674
77-
- name: Build for musl
78-
if: ${{ matrix.target == 'linux' && matrix.libc == 'musl' }}
79-
run: ./make.sh
75+
- name: Build for x64 glibc
76+
if: ${{ matrix.platform == 'linux-x64' && matrix.libc != 'musl' }}
77+
run: |
78+
docker build -t ubuntu-18.04 .
79+
docker run --rm -v $(pwd):$(pwd) -w $(pwd) ubuntu-18.04 bash -c './make.sh'
8080
8181
- name: Setting up workflow variables
8282
id: vars
@@ -114,7 +114,7 @@ jobs:
114114
echo PKG_PATH="${PKG_STAGING}/${PKG_NAME}" >> $GITHUB_OUTPUT
115115
echo PKG_STAGING=${PKG_STAGING} >> $GITHUB_OUTPUT
116116
117-
- uses: actions/upload-artifact@v3
117+
- uses: actions/upload-artifact@v4
118118
with:
119119
name: ${{ steps.vars.outputs.PKG_BASENAME }}
120120
path: |

.github/workflows/changelog.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: changelog
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
branches:
7+
- master
8+
9+
jobs:
10+
check-changelog:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Set up environment
19+
run: |
20+
echo "GITHUB_SOURCE_REF=${{ github.ref_name }}" >> $GITHUB_ENV
21+
echo "GITHUB_BASE_REF=${{ github.base_ref }}" >> $GITHUB_ENV
22+
23+
- name: Check if changelog is updated
24+
run: .github/scripts/check-changelog.sh

.github/workflows/test.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,25 @@ jobs:
66
fail-fast: false
77
matrix:
88
include:
9-
- { os: ubuntu-20.04, platform: linux-x64 }
10-
- { os: macos-14, platform: darwin-arm64 }
11-
- { os: windows-latest, platform: win32-x64 }
9+
- { os: ubuntu-20.04, target: linux, platform: linux-x64 }
10+
- { os: macos-14, target: darwin, platform: darwin-arm64 }
11+
- { os: windows-latest, target: windows, platform: win32-x64 }
1212
runs-on: ${{ matrix.os }}
1313
steps:
1414
- uses: actions/checkout@v4
1515
with:
1616
submodules: recursive
17-
- uses: actboy168/setup-luamake@master
18-
- run: luamake -platform ${{ matrix.platform }}
17+
- name: Build for Windows
18+
if: ${{ matrix.target == 'windows' }}
19+
run: .\make.bat
20+
- name: Build for Linux
21+
if: ${{ matrix.target == 'linux' }}
22+
run: |
23+
sudo apt update
24+
sudo apt install ninja-build
25+
./make.sh
26+
- name: Build for macOS
27+
if: ${{ matrix.target == 'darwin' }}
28+
run: |
29+
brew install ninja
30+
./make.sh

.luarc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
23
"diagnostics": {
34
"disable": [
45
"close-non-object",

.vscode/launch.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
"print",
1818
"stderr",
1919
],
20+
"windows": {
21+
"luaexe": "${workspaceFolder}/bin/lua-language-server.exe"
22+
}
2023
},
2124
{
2225
"name": "🍄attach",
@@ -48,6 +51,9 @@
4851
"request": "launch",
4952
"stopOnEntry": false,
5053
"luaexe": "${workspaceFolder}/bin/lua-language-server",
54+
"windows": {
55+
"luaexe": "${workspaceFolder}/bin/lua-language-server.exe"
56+
},
5157
"program": "${workspaceRoot}/tools/build-3rd-meta.lua",
5258
"cpath": "${workspaceFolder}/bin/?.dll;${workspaceFolder}/bin/?.so",
5359
"console": "integratedTerminal",
@@ -67,6 +73,9 @@
6773
"request": "launch",
6874
"stopOnEntry": false,
6975
"luaexe": "${workspaceFolder}/bin/lua-language-server",
76+
"windows": {
77+
"luaexe": "${workspaceFolder}/bin/lua-language-server.exe"
78+
},
7079
"program": "${workspaceRoot}/tools/locale.lua",
7180
"cpath": "${workspaceFolder}/bin/?.dll;${workspaceFolder}/bin/?.so",
7281
"console": "integratedTerminal",
@@ -86,6 +95,9 @@
8695
"request": "launch",
8796
"stopOnEntry": false,
8897
"luaexe": "${workspaceFolder}/bin/lua-language-server",
98+
"windows": {
99+
"luaexe": "${workspaceFolder}/bin/lua-language-server.exe"
100+
},
89101
"program": "${workspaceRoot}/tools/build-doc.lua",
90102
"cpath": "${workspaceFolder}/bin/?.dll;${workspaceFolder}/bin/?.so",
91103
"console": "integratedTerminal",
@@ -106,6 +118,9 @@
106118
"stopOnEntry": false,
107119
"program": "${workspaceRoot}/main.lua",
108120
"luaexe": "${workspaceFolder}/bin/lua-language-server",
121+
"windows": {
122+
"luaexe": "${workspaceFolder}/bin/lua-language-server.exe"
123+
},
109124
"cpath": null,
110125
"arg": [
111126
"--check",
@@ -125,6 +140,9 @@
125140
"stopOnEntry": false,
126141
"program": "${workspaceRoot}/main.lua",
127142
"luaexe": "${workspaceFolder}/bin/lua-language-server",
143+
"windows": {
144+
"luaexe": "${workspaceFolder}/bin/lua-language-server.exe"
145+
},
128146
"cpath": null,
129147
"arg": [
130148
"--doc",

3rd/bee.lua

Submodule bee.lua updated 131 files

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Dockerfile
2+
3+
FROM ubuntu:18.04
4+
5+
# Install necessary packages
6+
RUN apt-get update && \
7+
apt-get install -y software-properties-common && \
8+
add-apt-repository -y ppa:ubuntu-toolchain-r/test && \
9+
add-apt-repository -y ppa:git-core/ppa && \
10+
apt-get install -y git gcc-9 g++-9 wget tar gzip rsync ninja-build
11+
12+
# Use alternative gcc
13+
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100 && \
14+
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 100

0 commit comments

Comments
 (0)