Skip to content

Commit

Permalink
Add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
zxdong262 committed Nov 2, 2023
1 parent 97d90a4 commit 79d6074
Show file tree
Hide file tree
Showing 45 changed files with 594 additions and 666 deletions.
18 changes: 18 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# CONTRIBUTING

> First off, thank you for considering contributing to electerm-web.
> electerm-web is an open source project and I love to receive contributions from our community — you! There are many ways to contribute, from writing tutorials or blog posts, improving the documentation, submitting bug reports and feature requests or writing code which can be incorporated into electerm-web itself.
> Working on your first Pull Request? You can learn how from this *free* series, [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).
Basic process:

> 1. Create your own fork of the code
> 2. Do the changes in your fork
> 3. If you like the change and think the project could use it:
* Be sure you have followed the code style for the project by running `npm run lint`.
* Send a pull request

> Want to report a issue or give some suggestions?
[Submit a issue](https://github.com/electerm/electerm-web/issues/new)
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
github: electerm
open_collective: electerm
custom: https://paypal.me/zhaoxudongPS
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## 👉 [Please follow one of these issue templates](https://github.com/electerm/electerm-web/issues/new/choose) 👈
53 changes: 53 additions & 0 deletions .github/ISSUE_TEMPLATE/1-bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "\U0001F41B Bug report(提交bug)"
description: Create a report to help us improve
body:
- type: markdown
attributes:
value: |
Thank you for reporting an issue.
This issue tracker is for bugs and issues found within electerm-web.
If you require more general support please start a discussion on our discussion board https://github.com/electerm/electerm-web/discussions
Please fill in as much of the form below as you're able.
Before continue, make sure you are using the latest release: check https://github.com/electerm/electerm-web/releases for latest release, also please
仅用来追踪bug, 如果有其他的讨论请移步讨论区 https://github.com/electerm/electerm-web/discussions, 请务必确保问题是基于最新版本: https://github.com/electerm/electerm-web/releases
- type: input
attributes:
label: electerm-web Version and download file extension(electerm-web版本和下载文件后缀)
description: |
- electerm-web-xx.xx.xx-win-x64.tar.gz
validations:
required: true
- type: input
attributes:
label: Platform detail (平台详情)
description: |
windows 7/8/10/11, mac os(ARM or x64), or linux
UNIX: output of `uname -a`
Windows: output of `"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })"` in PowerShell console
validations:
required: true
- type: textarea
attributes:
label: What steps will reproduce the bug?(重新问题的详细步骤)
description: Enter details about your bug, preferably a simple code snippet that can be run using `node` directly without installing third-party dependencies.
validations:
required: true
- type: textarea
attributes:
label: What should have happened?(期望的结果)
description: If possible please provide screenshots.
validations:
required: true
- type: textarea
attributes:
label: Would this happen in other terminal app(是否能够在其他同类软件重现这个问题)
description: really important.
- type: textarea
attributes:
label: Additional information(其他任何相关信息)
description: Tell us anything else you think we should know.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/2-proposal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "💥 Proposal / Feature (建议和新功能)"
description: Propose a non-trivial change or new feature for electerm-web
body:
- type: textarea
attributes:
label: What feature you'd like to see or proposal(期望什么新功能/特性或者建议)
description: A clear and concise description of what the proposal or feature is.(请尽可能详细描述,以便帮助其他人能够理解)
validations:
required: true

5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: ⁉️ Need help with electerm-web?
url: https://github.com/electerm/electerm-web/discussions
about: Please start a discussion before opening a bug.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
47 changes: 47 additions & 0 deletions .github/workflows/mac-test-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: mac-test-1

on:
push:
branches: [ build, test ]

jobs:
build:

runs-on: macos-11
environment: build
if: "!contains(github.event.head_commit.message, '[skip test]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip mac]') && !contains(github.event.head_commit.message, '[skip test2]')"

steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x

# before_install:
- run: npm i
- run: npx playwright install chromium
# script:
- run: npm run build
- run: cp .sampe.env .env

- name: test
uses: GabrielBB/xvfb-action@v1
with:
run: npm run test1
env:
NODE_TEST: 1
TEST_HOST: ${{ secrets.TEST_HOST }}
TEST_USER: ${{ secrets.TEST_USER_DARWIN }}
TEST_PASS: ${{ secrets.TEST_PASS_DARWIN }}
GIST_TOKEN: ${{ secrets.GIST_TOKEN }}
GIST_ID: ${{ secrets.GIST_ID }}
GITEE_TOKEN: ${{ secrets.GITEE_TOKEN }}
GITEE_ID: ${{ secrets.GITEE_ID }}
CUSTOM_SYNC_URL: ${{ secrets.CUSTOM_SYNC_URL }}
CUSTOM_SYNC_USER: ${{ secrets.CUSTOM_SYNC_USER }}
CUSTOM_SYNC_SECRET: ${{ secrets.CUSTOM_SYNC_SECRET }}

47 changes: 47 additions & 0 deletions .github/workflows/mac-test-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: mac-test-2

on:
push:
branches: [ build, test ]

jobs:
build:

runs-on: macos-11
environment: build
if: "!contains(github.event.head_commit.message, '[skip test]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip mac]') && !contains(github.event.head_commit.message, '[skip test2]')"

steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x

# before_install:
- run: npm i
- run: npx playwright install chromium
# script:
- run: npm run build
- run: cp .sampe.env .env

- name: test
uses: GabrielBB/xvfb-action@v1
with:
run: npm run test2 && npm run test3
env:
NODE_TEST: 1
TEST_HOST: ${{ secrets.TEST_HOST }}
TEST_USER: ${{ secrets.TEST_USER_DARWIN }}
TEST_PASS: ${{ secrets.TEST_PASS_DARWIN }}
GIST_TOKEN: ${{ secrets.GIST_TOKEN }}
GIST_ID: ${{ secrets.GIST_ID }}
GITEE_TOKEN: ${{ secrets.GITEE_TOKEN }}
GITEE_ID: ${{ secrets.GITEE_ID }}
CUSTOM_SYNC_URL: ${{ secrets.CUSTOM_SYNC_URL }}
CUSTOM_SYNC_USER: ${{ secrets.CUSTOM_SYNC_USER }}
CUSTOM_SYNC_SECRET: ${{ secrets.CUSTOM_SYNC_SECRET }}

14 changes: 12 additions & 2 deletions .sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
HOST=127.0.0.1
PORT=5577
SERVER_SECRET=x4345655@!3446%5FS334*sfdgsf # change it in production env
ENABLE_SIMPLE_AUTH=1
# ENABLE_AUTH=1
SERVER_USER=admin
SERVER_PASS=1
TOKEN_EXPIRED_TIME=120y
# DB_PATH=/some/custom-path-to-db-folder
#
# to use same data as desktop electerm
Expand All @@ -28,4 +29,13 @@ TEST_HOST=your-host
TEST_USER=your-username

## test ssh password, required
TEST_PASS=your-pass
TEST_PASS=your-pass

# for sync data test
GIST_ID=
GIST_TOKEN=
GITEE_TOKEN=
GITEE_ID=
CUSTOM_SYNC_URL=
CUSTOM_SYNC_USER=
CUSTOM_SYNC_SECRET=
2 changes: 1 addition & 1 deletion build/bin/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const from1 = resolve(
)
const from3 = resolve(
cwd,
'../iTerm2-Color-Schemes/electerm/*'
'build/iTerm2-Color-Schemes/electerm/*'
)
const to1 = resolve(
cwd,
Expand Down
6 changes: 5 additions & 1 deletion build/vite/dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import os from 'os'
import copy from 'json-deep-copy'
import proxy from 'express-http-proxy'
import fsFunctions from '../../src/app/common/fs-functions.js'
import { createToken } from '../../src/app/lib/jwt.js'
import { logDir } from '../../src/app/server/session-log.js'

const devPort = env.DEV_PORT || 5570
const devHost = env.DEV_HOST || '127.0.0.1'
Expand All @@ -34,7 +36,9 @@ const base = {
packInfo: pack,
home: os.homedir(),
server: h,
stylus: loadDevStylus()
stylus: loadDevStylus(),
sessionLogPath: logDir,
tokenElecterm: process.env.ENABLE_AUTH ? '' : createToken()
}

function handleIndex (req, res) {
Expand Down
Loading

0 comments on commit 79d6074

Please sign in to comment.