Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Add test project to avoid breaking utils API #212

Merged
merged 19 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
52 changes: 0 additions & 52 deletions .eslintrc.js

This file was deleted.

30 changes: 30 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "import",
"format": [ "camelCase", "PascalCase" ]
}
],
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": [
"out",
"dist",
"**/*.d.ts"
]
}
46 changes: 33 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,64 @@ concurrency:
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
main:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
fail-fast: false

env:
CODE_VERSION: max
TEST_RESOURCES: test-res

steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: npm

- name: Install
run: npm ci

- name: Build
run: npm run build
- name: Tests (macOS, windows)
if: matrix.os != 'ubuntu-latest'
run: |
npm test

- name: Tests (linux)
if: matrix.os == 'ubuntu-latest'
run: |
xvfb-run --auto-servernum --server-args='-screen 0 1920x1080x24' npm test

- name: Compile
run: npm run compile
- name: Upload Screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
name: screenshots-${{ matrix.os }}
path: ${{ github.workspace }}/test/**/screenshots/*.png

check:
if: always()
runs-on: ubuntu-latest
name: Status Check
needs: [ test ]
needs: [ main ]
steps:
- name: Print Test Result
run: |
echo result = ${{ needs.test.result }}
echo result = ${{ needs.main.result }}
- name: Status Check - success
if: ${{ needs.test.result == 'success' }}
if: ${{ needs.main.result == 'success' }}
run: |
echo "All tests successfully completed!"
exit 0
- name: Status Check - failure
if: ${{ needs.test.result != 'success' }}
if: ${{ needs.main.result != 'success' }}
run: |
echo "Status Check failed!"
exit 1
exit 1
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ node_modules
test-resources
test-extensions
.npmrc
.vscode-test
test/utils-test-project/package-lock.json
test-res
Loading