Skip to content

ci: Add github workflow for nitro node #45

ci: Add github workflow for nitro node

ci: Add github workflow for nitro node #45

name: Test install nitro-node
on:
#schedule:
# - cron: "0 20 * * *" # At 8 PM UTC, which is 3 AM UTC+7
push:
branches:
- main
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
paths:
- ".github/scripts/e2e-test-install-nitro-node.js"
- ".github/workflows/test-install-nitro-node.yml"
- "nitro-node/**"
pull_request:
types: [opened, synchronize, reopened]
paths:
- ".github/scripts/e2e-test-install-nitro-node.js"
- ".github/workflows/test-install-nitro-node.yml"
- "nitro-node/**"
workflow_dispatch:
jobs:
linux-pack-tarball:
runs-on: ubuntu-latest
outputs:
tarball-url: ${{ steps.upload.outputs.artifact-url }}
steps:
- name: Clone
id: checkout
uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Build tarball
id: build
run: |
cd nitro-node
make pack
find . -type f -name 'janhq-nitro-node-*.tgz' -exec mv {} janhq-nitro-node.tgz \;
- name: Upload tarball as artifact
id: upload
uses: actions/upload-artifact@master
with:
name: janhq-nitro-node
path: nitro-node/janhq-nitro-node.tgz
if-no-files-found: error
ubuntu-install:
runs-on: ubuntu-latest
needs: [linux-pack-tarball]
if: always() && needs.linux-pack-tarball.result == 'success'
steps:
- name: Clone
id: checkout
uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Download prebuilt tarball
uses: actions/download-artifact@master
with:
name: janhq-nitro-node
path: .github/scripts/
- name: List tarball content
id: tar-tf
run: |
cd .github
cd scripts
tar tf janhq-nitro-node.tgz
- name: Run tests
id: test_install_nitro_node
env:
NITRO_NODE_PKG: ${{ github.workspace }}/.github/scripts/janhq-nitro-node.tgz
run: |
cd .github
cd scripts
node e2e-test-install-nitro-node.js
macOS-install:
runs-on: macos-latest
needs: [linux-pack-tarball]
if: always() && needs.linux-pack-tarball.result == 'success'
steps:
- name: Clone
id: checkout
uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Download prebuilt tarball
uses: actions/download-artifact@master
with:
name: janhq-nitro-node
path: .github/scripts/
- name: List tarball content
id: tar-tf
run: |
cd .github
cd scripts
tar tf janhq-nitro-node.tgz
- name: Run tests
id: test_install_nitro_node
env:
NITRO_NODE_PKG: ${{ github.workspace }}/.github/scripts/janhq-nitro-node.tgz
run: |
cd .github
cd scripts
node e2e-test-install-nitro-node.js
windows-install:
runs-on: windows-latest
needs: [linux-pack-tarball]
if: always() && needs.linux-pack-tarball.result == 'success'
steps:
- name: Clone
id: checkout
uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Download prebuilt tarball
uses: actions/download-artifact@master
with:
name: janhq-nitro-node
path: .github/scripts/
- name: List tarball content
id: tar-tf
run: |
cd .github
cd scripts
tar tf janhq-nitro-node.tgz
- name: Run tests
id: test_install_nitro_node
env:
NITRO_NODE_PKG: ${{ github.workspace }}\.github\scripts\janhq-nitro-node.tgz
run: |
cd .github
cd scripts
node e2e-test-install-nitro-node.js