Skip to content

Commit

Permalink
Split packaging from Linux build in CI (#31)
Browse files Browse the repository at this point in the history
* Split packaging from Linux build

* Add checkout, npm install in package step

* Fix decision to build bscript

* Separate build from install
  • Loading branch information
KevinEady authored Dec 20, 2023
1 parent 31ae4be commit ec4c49b
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 42 deletions.
101 changes: 70 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ on:

jobs:
linux:
name: Build and Test [Linux]; Package [Universal]
name: Build and Test [Linux]
runs-on: ubuntu-latest
needs: [windows, mac]

steps:
- uses: actions/checkout@v3
Expand All @@ -30,39 +29,15 @@ jobs:
path: native/polserver
key: linux-polserver-full-${{ steps.get-ref.outputs.ref }}

- run: npm install
- run: npm install && npm run build

- run: npm test

- name: Download Temporary Artifact darwin-universal
uses: actions/download-artifact@v3
with:
name: vscode-escript-native.darwin-universal
path: native/build/Release

- name: Download Temporary Artifact win32-x64
uses: actions/download-artifact@v3
with:
name: vscode-escript-native.win32-x64
path: native/build/Release

- run: npx vsce package

- name: Upload Extension Artifact
uses: actions/upload-artifact@v3
with:
name: escript-lsp-universal
path: escript-lsp-*.vsix

- name: Delete Temporary Artifact darwin-universal
uses: geekyeggo/delete-artifact@v2
with:
name: vscode-escript-native.darwin-universal

- name: Delete Temporary Artifact win32-x64
uses: geekyeggo/delete-artifact@v2
with:
name: vscode-escript-native.win32-x64
name: vscode-escript-native.linux-x64
path: native/build/Release/vscode-escript-native.linux-x64.node

windows:
name: Build and Test [Windows]
Expand All @@ -85,7 +60,7 @@ jobs:
path: native/polserver
key: windows-polserver-full-${{ steps.get-ref.outputs.ref }}

- run: npm install
- run: npm install && npm run build

- run: npm run eslint

Expand Down Expand Up @@ -121,7 +96,7 @@ jobs:
run: |
echo "PKG_CONFIG_PATH=/usr/local/opt/openssl@1.1/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
- run: npm install
- run: npm install && npm run build

- run: npm test

Expand All @@ -130,3 +105,67 @@ jobs:
with:
name: vscode-escript-native.darwin-universal
path: native/build/Release/vscode-escript-native.darwin-universal.node

package:
name: Package
runs-on: ubuntu-latest
needs: [windows, mac, linux]

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Get polserver HEAD ref
id: get-ref
run: |
echo "ref=$( cd native/polserver && git log -1 --format=%h )" >> $GITHUB_OUTPUT
- name: Cache polserver
uses: actions/cache@v3
with:
path: native/polserver
key: linux-polserver-full-${{ steps.get-ref.outputs.ref }}

- run: npm install

- name: Download Temporary Artifact darwin-universal
uses: actions/download-artifact@v3
with:
name: vscode-escript-native.darwin-universal
path: native/build/Release

- name: Download Temporary Artifact win32-x64
uses: actions/download-artifact@v3
with:
name: vscode-escript-native.win32-x64
path: native/build/Release

- name: Download Temporary Artifact linux-x64
uses: actions/download-artifact@v3
with:
name: vscode-escript-native.linux-x64
path: native/build/Release

- run: npx vsce package

- name: Upload Extension Artifact
uses: actions/upload-artifact@v3
with:
name: escript-lsp-universal
path: escript-lsp-*.vsix

- name: Delete Temporary Artifact darwin-universal
uses: geekyeggo/delete-artifact@v2
with:
name: vscode-escript-native.darwin-universal

- name: Delete Temporary Artifact win32-x64
uses: geekyeggo/delete-artifact@v2
with:
name: vscode-escript-native.win32-x64

- name: Delete Temporary Artifact linux-x64
uses: geekyeggo/delete-artifact@v2
with:
name: vscode-escript-native.linux-x64
4 changes: 2 additions & 2 deletions native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ if (MSVC)
endif()

set(SHOULD_BUILD_BSCRIPT FALSE)
foreach(POLSERVER_LIB BSCRIPT_LIBS)
foreach(POLSERVER_LIB ${BSCRIPT_LIBS})
if (NOT EXISTS "${POLSERVER_LIB}")
message("- will build bscript: ${POLSERVER_LIB} is missing")
set(SHOULD_BUILD_BSCRIPT TRUE)
break()
endif()
endforeach()

if (SHOULD_BUILD_BSCRIPT)
message("- will build libbscript")
ExternalProject_Add(libbscript
SOURCE_DIR ${BSCRIPT_SOURCE_DIR}
PREFIX blinb
Expand Down
1 change: 0 additions & 1 deletion native/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@
]
},
"scripts": {
"install": "cmake-js rebuild && tsc",
"rebuild": "cmake-js rebuild",
"build": "cmake-js build && tsc",
"rebuild": "cmake-js rebuild && tsc",
"clean": "cmake-js clean",
"build": "cmake-js build -D",
"build-debug": "cmake-js build -B RelWithDebInfo",
"rebuild-debug": "cmake-js rebuild -B RelWithDebInfo"
"build-debug": "cmake-js build -B RelWithDebInfo && tsc",
"rebuild-debug": "cmake-js rebuild -B RelWithDebInfo && tsc"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@
]
},
"scripts": {
"vscode:prepublish": "npm run clean && npm run compile",
"vscode:prepublish": "npm run clean && npm run build",
"postinstall": "cd client && npm install && cd ../native && npm install && cd ../server && npm install",
"watch": "npm run grammar && tsc -b -w",
"compile": "npm run grammar && tsc -b",
"build": "npm run grammar && tsc -b && cd native && npm run build",
"clean": "rimraf client/out server/out grammars/escript.json",
"e2e": "cd client && npm test",
"test": "jest --coverage",
Expand Down
1 change: 0 additions & 1 deletion server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ec4c49b

Please sign in to comment.