Adds automatic test and linting on pull requests for nodegui (#215)

* adds test action

* make c++11 mandatory

* fix

* fix

* fix broken tests in windows

* upgrade qode to 1.0.6

* Fixes recursive hell for layouts

* adds cross env for windows

* change to pull request
This commit is contained in:
Atul R 2019-11-22 23:43:54 +01:00 committed by GitHub
parent 8a93f69e03
commit 6ac7303e16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 14 deletions

25
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,25 @@
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: '13.x'
- name: Install deps
run: npm install
- name: Build nodegui
run: npm run build
- name: Run tests
run: npm run test
- name: Run linters for cpp
run: npm run lint:cpp
- name: Run linters for ts
run: npm run lint:ts

18
package-lock.json generated
View File

@ -452,9 +452,9 @@
}
},
"@nodegui/qode": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@nodegui/qode/-/qode-1.0.5.tgz",
"integrity": "sha512-JKb4JcC03VCdodmiL35VfznsCKHpiKOYbtgf9+KTHhH5p7IXvr+0k/LIq112T6Rpxd5zXa1pbsnfa2F8ReyWEg==",
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/@nodegui/qode/-/qode-1.0.6.tgz",
"integrity": "sha512-Np6r91wDCzV4+PCepr83t+BjWBtZMh5WT9/68mXXSMJi+ueZbYXL0d5VAIJ84C87NMwnA/7hdoqppp8lgzymvg==",
"requires": {
"env-paths": "^2.2.0",
"extract-zip": "^1.6.7",
@ -1731,9 +1731,9 @@
"dev": true
},
"defer-to-connect": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.0.2.tgz",
"integrity": "sha512-k09hcQcTDY+cwgiwa6PYKLm3jlagNzQ+RSvhjzESOGOx+MNOuXkxTfEvPrO1IOQ81tArCFYQgi631clB70RpQw=="
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.0.tgz",
"integrity": "sha512-WE2sZoctWm/v4smfCAdjYbrfS55JiMRdlY9ZubFhsYbteCK9+BvAx4YV7nPjYM6ZnX5BcoVKwfmyx9sIFTgQMQ=="
},
"define-properties": {
"version": "1.1.3",
@ -5103,9 +5103,9 @@
}
},
"normalize-url": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.3.0.tgz",
"integrity": "sha512-0NLtR71o4k6GLP+mr6Ty34c5GA6CMoEsncKJxvQd8NzPxaHRJNnb5gZE8R1XF4CPIS7QPHLJ74IFszwtNVAHVQ=="
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz",
"integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ=="
},
"npm-run-path": {
"version": "2.0.2",

View File

@ -20,12 +20,12 @@
"postinstall": "npm run build:addon",
"build": "tsc && npm run build:addon",
"build:addon": "cross-env CMAKE_BUILD_PARALLEL_LEVEL=8 cmake-js compile",
"test": "qode ./node_modules/.bin/jest -i",
"test": "qode ./node_modules/jest/bin/jest -i",
"lint:cpp": "clang-format -i --glob=src/cpp/**/*.[h,c]*",
"lint:ts": "tsc --noEmit && eslint './src/**/*.{ts,tsx,js,jsx}' --fix"
"lint:ts": "tsc --noEmit && cross-env eslint './src/**/*.{ts,tsx,js,jsx}' --fix"
},
"dependencies": {
"@nodegui/qode": "^1.0.5",
"@nodegui/qode": "^1.0.6",
"cmake-js": "^6.0.0",
"cross-env": "^6.0.0",
"cuid": "^2.1.6",

View File

@ -6,6 +6,6 @@
class NGridLayout : public QGridLayout, public EventWidget {
public:
Q_OBJECT
EVENTWIDGET_IMPLEMENTATIONS(NGridLayout)
EVENTWIDGET_IMPLEMENTATIONS(QGridLayout)
using QGridLayout::QGridLayout;
};

View File

@ -41,5 +41,5 @@ class FlexLayout : public QLayout, public EventWidget {
Qt::Orientations expandingDirections() const override;
bool hasHeightForWidth() const override;
EVENTWIDGET_IMPLEMENTATIONS(FlexLayout)
EVENTWIDGET_IMPLEMENTATIONS(QLayout)
};