Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Alternative build/test without lix/vshaxe-build #122

Merged
merged 10 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Avoid differences between unix and windows CI there
install.hxml text eol=crlf
48 changes: 48 additions & 0 deletions .github/workflows/main-vanilla.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI - Vanilla

on: [push, pull_request]

jobs:
build:
strategy:
fail-fast: false
matrix:
# TODO: fix tests on windows and enable again
# os: [ubuntu-latest, macos-13, windows-latest]
os: [ubuntu-latest, macos-13]
haxe: [latest, "2024-11-27_development_2dc801f"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

- uses: krdlab/setup-haxe@master
with:
haxe-version: ${{ matrix.haxe }}

- name: Cache haxelib
id: cache-haxelib
uses: actions/[email protected]
with:
path: .haxelib
key: ${{ hashFiles('./install.hxml') }}

- name: Install npm dependencies
run: |
npm ci --ignore-scripts

- name: Install haxelib dependencies
if: steps.cache-haxelib.outputs.cache-hit != 'true'
run: |
haxelib newrepo
haxelib state load install.hxml

- name: Check dependencies
run: |
haxe -version
haxelib list

- name: Build Haxe LSP
run: haxe build.hxml

- name: Run tests
run: haxe test.hxml
29 changes: 29 additions & 0 deletions build.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-lib hxnodejs
-lib hxparse
-lib haxeparser
-lib tokentree
-lib formatter
-lib rename
-lib json2object
-lib language-server-protocol
-lib vscode-json-rpc
-lib uglifyjs
-lib safety

-cp src
-cp shared

-D analyzer-optimize
-D js-unflatten
-D js-es=6
-D JSTACK_FORMAT=vscode
-D uglifyjs_overwrite
--dce full
--debug

--macro haxeLanguageServer.Init.run()
--macro Safety.safeNavigation('haxeLanguageServer')
--macro nullSafety('haxeLanguageServer')

-js bin/server.js
-main haxeLanguageServer.Main
15 changes: 15 additions & 0 deletions install.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-lib uglifyjs:1.0.0
-lib formatter:1.18.0
-lib haxeparser:git:https://github.com/HaxeCheckstyle/haxeparser#a5fce2ecf5fb3bdfebfd7efd8b05329d456ec0d2
-lib hxparse:git:https://github.com/simn/hxparse#876070ec62a4869de60081f87763e23457a3bda8
-lib json2object:git:https://github.com/elnabo/json2object#a75859de1e966c09e73591b6c9186086c143fe60
-lib test-adapter:2.0.7
-lib utest:git:https://github.com/haxe-utest/utest#bdb5fec4b8e77d9a3c079d9cfb108f29f153721a
-lib hxnodejs:git:https://github.com/HaxeFoundation/hxnodejs#504066d
-lib tokentree:1.2.17
-lib language-server-protocol:git:https://github.com/vshaxe/language-server-protocol-haxe#a6baa2ddcd792e99b19398048ef95aa00f0aa1f6
-lib hxjsonast:1.1.0
-lib vscode-json-rpc:git:https://github.com/vshaxe/vscode-json-rpc#0160f06bc9df1dd0547f2edf23753540db74ed5b
-lib rename:3.0.0
-lib vshaxe-build:git:https://github.com/vshaxe/vshaxe-build#39ab9c6315ae76080e5399391c8fa561daec6d55
-lib safety:1.1.2
27 changes: 27 additions & 0 deletions test.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-lib hxnodejs
-lib hxparse
-lib haxeparser
-lib tokentree
-lib formatter
-lib rename
-lib json2object
-lib language-server-protocol
-lib vscode-json-rpc
-lib safety
-lib utest

-cp src
-cp shared
-cp test

--macro Safety.safeNavigation('haxeLanguageServer')

-D analyzer-optimize
-D js-unflatten
-D js-es=6
--dce full
--debug

-main TestMain
-js bin/test.js
-cmd node bin/test.js
4 changes: 2 additions & 2 deletions test/codeActions/AddMissingArgsTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class AddMissingArgsTest extends DisplayTestCase {
function foo10(arg:Bytes) {}
function foo11(arg:Bytes) {}
**/
@:timeout(500)
@:timeout(10000)
function test(async:utest.Async) {
ctx.cacheFile();
ctx.startServer(() -> {
Expand Down Expand Up @@ -155,7 +155,7 @@ class AddMissingArgsTest extends DisplayTestCase {
public function new(i:Int) {}
}
**/
@:timeout(500)
@:timeout(1000)
function testConstructorArg(async:utest.Async) {
ctx.cacheFile();
ctx.startServer(() -> {
Expand Down
2 changes: 1 addition & 1 deletion test/codeActions/AddTypeHintActionsTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class AddTypeHintActionsTest extends DisplayTestCase {
}
}
**/
@:timeout(500)
@:timeout(5000)
function test(async:utest.Async) {
ctx.cacheFile();
ctx.startServer(() -> {
Expand Down
Loading