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

GitHub Actions #4693

Merged
merged 61 commits into from
Aug 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
2f016f4
Create node.js.yml
Tyriar Aug 19, 2023
6282f9a
npm -> yarn
Tyriar Aug 19, 2023
d58283f
Add integration test job
Tyriar Aug 19, 2023
6472089
Add firefox api tests
Tyriar Aug 19, 2023
2e87c4b
Tidy up codeql.yml
Tyriar Aug 19, 2023
602da60
Add release workflow
Tyriar Aug 19, 2023
a24d671
Set up auth
Tyriar Aug 19, 2023
df1e7ed
Use env var
Tyriar Aug 19, 2023
8d7f42d
Improve publish dry run
Tyriar Aug 19, 2023
fecdc38
Disable publish on az pipelines
Tyriar Aug 19, 2023
35801a0
Disable dry run, remove release on pr
Tyriar Aug 19, 2023
18d0881
Install playwright on all platforms
Tyriar Aug 19, 2023
1c919e3
Experiment with build artifacts
Tyriar Aug 19, 2023
216bd9d
Add dependency to build2
Tyriar Aug 19, 2023
2f97b5b
Tweak artifacts
Tyriar Aug 19, 2023
e8a2795
Temporarily disable tests
Tyriar Aug 19, 2023
603d69b
Try use zip
Tyriar Aug 19, 2023
efd854d
Zip progress
Tyriar Aug 19, 2023
8aa019a
Tweak unzip
Tyriar Aug 19, 2023
27ba753
Change zip contents
Tyriar Aug 19, 2023
2bbda34
Tweak zip
Tyriar Aug 19, 2023
4b46060
Fix zip
Tyriar Aug 19, 2023
21b77b8
cd into dir
Tyriar Aug 19, 2023
f1e6b7d
Explicitly list out dirs to archive
Tyriar Aug 19, 2023
4319513
Fix file permissions
Tyriar Aug 19, 2023
02563d2
Add missing line wraps
Tyriar Aug 19, 2023
8741ea0
Renames
Tyriar Aug 19, 2023
d01311e
Fix file name
Tyriar Aug 19, 2023
87ae309
Try without zipping
Tyriar Aug 19, 2023
4220e0c
Revert "Try without zipping"
Tyriar Aug 19, 2023
862249c
Try double unzip
Tyriar Aug 19, 2023
c19ccd6
Fix zip name, install without scripts
Tyriar Aug 19, 2023
760e36f
Include inwasm build
Tyriar Aug 19, 2023
1ceb33c
Qualify paths
Tyriar Aug 19, 2023
be1eab0
ls after download
Tyriar Aug 19, 2023
8aff48b
Don't double unzip
Tyriar Aug 19, 2023
6c9fbbb
Use -d flag
Tyriar Aug 19, 2023
302870d
Verbose unzip
Tyriar Aug 19, 2023
46dead3
Skip download on lint, download on unit tests
Tyriar Aug 19, 2023
b476d01
Use yarn cache
Tyriar Aug 19, 2023
31be6d1
Remove whitespace
Tyriar Aug 19, 2023
8b7bcd5
Split install deps and build
Tyriar Aug 19, 2023
63ff9b5
Print structure after unzip
Tyriar Aug 19, 2023
7fa0225
Don't set dir
Tyriar Aug 19, 2023
fdd29a4
Change dir
Tyriar Aug 19, 2023
e2b7554
Not verbose
Tyriar Aug 19, 2023
ff8e4ac
Don't include inwasm
Tyriar Aug 19, 2023
2556751
Remove yarn prepare
Tyriar Aug 19, 2023
34a4dbc
Include inwasm in archive
Tyriar Aug 19, 2023
382e4f2
Overwrite when unzipping
Tyriar Aug 19, 2023
ace0243
Overwrite unzip files on Windows
Tyriar Aug 19, 2023
394409b
Build inwasm in tests
Tyriar Aug 19, 2023
eecbfba
Change to install addon deps
Tyriar Aug 19, 2023
f7e78f7
Move addon install to yarn
Tyriar Aug 19, 2023
52e7963
Add build step to release workflow
Tyriar Aug 19, 2023
a2d2711
Add integration test jobs back
Tyriar Aug 19, 2023
d469e32
Download in integration tests
Tyriar Aug 19, 2023
7b28ecc
Disable macOS integration tests
Tyriar Aug 19, 2023
593c553
Use browser strategy
Tyriar Aug 19, 2023
792d7cd
Remove azure pipeline
Tyriar Aug 19, 2023
dbe1ad2
Simplify build step
Tyriar Aug 19, 2023
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
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.x, 18.x]
runs-on: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.runs-on }}
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 }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
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.x]
runs-on: [ubuntu-latest, windows-latest] # macos-latest is flaky
browser: [chromium, firefox]
runs-on: ${{ matrix.runs-on }}
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 }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
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
72 changes: 0 additions & 72 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: '41 17 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- 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
Loading