Skip to content

Commit

Permalink
Merge branch 'master' into demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar authored Aug 20, 2023
2 parents a20599e + 427d33c commit 6021e6c
Show file tree
Hide file tree
Showing 11 changed files with 237 additions and 293 deletions.
133 changes: 133 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'yarn'
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Build
run: yarn setup
- name: Zip artifacts
run: |
zip -r compressed-build \
./out/* \
./out-test/* \
./addons/xterm-addon-attach/out/* \
./addons/xterm-addon-attach/out-test/* \
./addons/xterm-addon-canvas/out/* \
./addons/xterm-addon-canvas/out-test/* \
./addons/xterm-addon-fit/out/* \
./addons/xterm-addon-fit/out-test/* \
./addons/xterm-addon-image/inwasm-builds/out/* \
./addons/xterm-addon-image/out/* \
./addons/xterm-addon-image/out-test/* \
./addons/xterm-addon-ligatures/out/* \
./addons/xterm-addon-ligatures/out-test/* \
./addons/xterm-addon-search/out/* \
./addons/xterm-addon-search/out-test/* \
./addons/xterm-addon-serialize/out/* \
./addons/xterm-addon-serialize/out-test/* \
./addons/xterm-addon-unicode11/out/* \
./addons/xterm-addon-unicode11/out-test/* \
./addons/xterm-addon-web-links/out/* \
./addons/xterm-addon-web-links/out-test/* \
./addons/xterm-addon-webgl/out/* \
./addons/xterm-addon-webgl/out-test/*
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: compressed-build.zip
if-no-files-found: error

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'yarn'
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Lint code
run: yarn lint
- name: Lint API
run: yarn lint-api

unit-tests:
needs: build
strategy:
matrix:
node-version: [16, 18]
runs-on: [ubuntu, macos, windows]
runs-on: ${{ matrix.runs-on }}-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: build-artifacts
- name: Unzip artifacts (Linux, macOS)
if: runner.os != 'Windows'
run: unzip -o compressed-build.zip
- name: Unzip artifacts (Windows)
if: runner.os == 'Windows'
run: 7z x compressed-build.zip -aoa -o${{ github.workspace }}
- name: Print directory structure
run: ls -R
- name: Use Node.js ${{ matrix.node-version }}.x
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}.x
cache: 'yarn'
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Unit tests
run: yarn test-unit --forbid-only

integration-tests:
needs: build
strategy:
matrix:
node-version: [18]
runs-on: [ubuntu, windows] # macos is flaky
browser: [chromium, firefox]
runs-on: ${{ matrix.runs-on }}-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: build-artifacts
- name: Unzip artifacts (Linux, macOS)
if: runner.os != 'Windows'
run: unzip -o compressed-build.zip
- name: Unzip artifacts (Windows)
if: runner.os == 'Windows'
run: 7z x compressed-build.zip -aoa -o${{ github.workspace }}
- name: Print directory structure
run: ls -R
- name: Use Node.js ${{ matrix.node-version }}.x
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}.x
cache: 'yarn'
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Install playwright
run: npx playwright install
- name: Integration tests (${{ matrix.browser }})
run: yarn test-api-${{ matrix.browser }} --headless --forbid-only
37 changes: 0 additions & 37 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '41 17 * * 0'
Expand All @@ -33,40 +21,15 @@ jobs:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release

on:
push:
# If a commit reaches master, assume it has passed CI via PR and publish
# without running tests to save time to publish
branches: [ "master" ]

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'yarn'
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Build
run: yarn setup
- name: Package headless
run: |
yarn package-headless
node ./bin/package_headless.js
- name: Publish to npm
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: node ./bin/publish.js
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# [![xterm.js logo](logo-full.png)](https://xtermjs.org)

[![Build Status](https://dev.azure.com/xtermjs/xterm.js/_apis/build/status/xtermjs.xterm.js)](https://dev.azure.com/xtermjs/xterm.js/_build/latest?definitionId=3)

Xterm.js is a front-end component written in TypeScript that lets applications bring fully-featured terminals to their users in the browser. It's used by popular projects such as VS Code, Hyper and Theia.

## Features
Expand Down
33 changes: 15 additions & 18 deletions addons/xterm-addon-image/src/base64.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ describe('Base64Decoder', () => {
assert.deepEqual(dec.data8, inp);
}
});
it('1+2 bytes', function() {
this.timeout(20000);
const dec = new Base64Decoder(0);
for (let a = 0; a < 256; ++a) {
for (let a = 0; a < 256; ++a) {
it(`1+2 bytes (${a})`, function() {
const dec = new Base64Decoder(0);
for (let b = 0; b < 256; ++b) {
dec.init(2);
const inp = new Uint8Array([a, b]);
Expand All @@ -57,12 +56,11 @@ describe('Base64Decoder', () => {
assert.strictEqual(dec.end(), 0);
assert.deepEqual(dec.data8, inp);
}
}
});
it('2+3 bytes', function() {
this.timeout(20000);
const dec = new Base64Decoder(0);
for (let a = 0; a < 256; ++a) {
});
}
for (let a = 0; a < 256; ++a) {
it(`2+3 bytes (${a})`, function() {
const dec = new Base64Decoder(0);
for (let b = 0; b < 256; ++b) {
dec.init(3);
const inp = new Uint8Array([0, a, b]);
Expand All @@ -71,12 +69,11 @@ describe('Base64Decoder', () => {
assert.strictEqual(dec.end(), 0);
assert.deepEqual(dec.data8, inp);
}
}
});
it('3+4 bytes', function() {
this.timeout(20000);
const dec = new Base64Decoder(0);
for (let a = 0; a < 256; ++a) {
});
}
for (let a = 0; a < 256; ++a) {
it(`3+4 bytes (${a})`, function() {
const dec = new Base64Decoder(0);
for (let b = 0; b < 256; ++b) {
dec.init(4);
const inp = new Uint8Array([0, 0, a, b]);
Expand All @@ -85,8 +82,8 @@ describe('Base64Decoder', () => {
assert.strictEqual(dec.end(), 0);
assert.deepEqual(dec.data8, inp);
}
}
});
});
}
it('padding', () => {
const dec = new Base64Decoder(0);
const d = fromBs('Hello, here comes the mouse');
Expand Down
Loading

0 comments on commit 6021e6c

Please sign in to comment.