Skip to content

Commit 2317dc4

Browse files
codebyterecclaussimatlopez
authored andcommitted
ci: switch to GitHub Actions
Co-authored-by: Christian Clauss <[email protected]> Co-authored-by: Matias Lopez <[email protected]> PR-URL: #2210 Closes: #2127 Closes: #2209
1 parent 2cca9b7 commit 2317dc4

File tree

4 files changed

+62
-138
lines changed

4 files changed

+62
-138
lines changed

.github/workflows/Python_tests.yml

-40
This file was deleted.

.github/workflows/tests.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# TODO: Line 47, enable pytest --doctest-modules
2+
3+
name: Tests
4+
on: [push, pull_request]
5+
jobs:
6+
Tests:
7+
strategy:
8+
fail-fast: false
9+
max-parallel: 15
10+
matrix:
11+
node: [10.x, 12.x, 14.x]
12+
python: [3.6, 3.7, 3.8]
13+
os: [macos-latest, ubuntu-latest, windows-latest]
14+
runs-on: ${{ matrix.os }}
15+
steps:
16+
- name: Checkout Repository
17+
uses: actions/checkout@v2
18+
- name: Use Node.js ${{ matrix.node }}
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: ${{ matrix.node }}
22+
- name: Use Python ${{ matrix.python }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python }}
26+
env:
27+
PYTHON_VERSION: ${{ matrix.python }}
28+
- name: Install Dependencies
29+
run: |
30+
npm install --no-progress
31+
pip install flake8 pytest
32+
- name: Set Windows environment
33+
if: matrix.os == 'windows-latest'
34+
run:
35+
echo '::set-env name=GYP_MSVS_VERSION::2015'
36+
echo '::set-env name=GYP_MSVS_OVERRIDE_PATH::C:\\Dummy'
37+
- name: Lint Python
38+
if: matrix.os == 'ubuntu-latest'
39+
run: |
40+
# stop the build if there are Python syntax errors or undefined names
41+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
42+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
43+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
44+
- name: Run Python tests
45+
run: |
46+
python -m pytest
47+
# - name: Run doctests with pytest
48+
# run: python -m pytest --doctest-modules
49+
- name: Run Node tests
50+
run: |
51+
npm test

.travis.yml

-93
This file was deleted.

test/test-options.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@
33
const test = require('tap').test
44
const gyp = require('../lib/node-gyp')
55

6-
test('options in environment', function (t) {
6+
test('options in environment', (t) => {
77
t.plan(1)
88

99
// `npm test` dumps a ton of npm_config_* variables in the environment.
1010
Object.keys(process.env)
11-
.filter(function (key) { return /^npm_config_/.test(key) })
12-
.forEach(function (key) { delete process.env[key] })
11+
.filter((key) => /^npm_config_/.test(key))
12+
.forEach((key) => { delete process.env[key] })
13+
14+
// in some platforms, certain keys are stubborn and cannot be removed
15+
const keys = Object.keys(process.env)
16+
.filter((key) => /^npm_config_/.test(key))
17+
.map((key) => key.substring('npm_config_'.length))
18+
.concat('argv', 'x')
1319

1420
// Zero-length keys should get filtered out.
1521
process.env.npm_config_ = '42'
@@ -18,8 +24,8 @@ test('options in environment', function (t) {
1824
// Except loglevel.
1925
process.env.npm_config_loglevel = 'debug'
2026

21-
var g = gyp()
27+
const g = gyp()
2228
g.parseArgv(['rebuild']) // Also sets opts.argv.
2329

24-
t.deepEqual(Object.keys(g.opts).sort(), ['argv', 'x'])
30+
t.deepEqual(Object.keys(g.opts).sort(), keys.sort())
2531
})

0 commit comments

Comments
 (0)