Skip to content

Commit

Permalink
Use node 18 on CI (#3157)
Browse files Browse the repository at this point in the history
* Delete .gitpod.DockerFile

* use node 16 on CI

* replace localhost with 127.0.0.1

* Update index.js

16 to 18

---------

Co-authored-by: Romain Beaumont <romain.rom1@gmail.com>
  • Loading branch information
extremeheat and rom1504 committed Aug 20, 2023
1 parent 9ecdf20 commit d3df34d
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
- name: Use Node.js 18.x
uses: actions/setup-node@v1.4.4
with:
node-version: 14.x
node-version: 18.x
- run: npm i && npm run lint

MinecraftServer:
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1.4.4
with:
node-version: 14.x
node-version: 18.x
- name: Setup Java JDK
uses: actions/setup-java@v1.4.3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@master
with:
node-version: 14.0.0
node-version: 18.0.0
- id: publish
uses: JS-DevTools/npm-publish@v1
with:
Expand Down
11 changes: 0 additions & 11 deletions .gitpod.DockerFile

This file was deleted.

2 changes: 0 additions & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
image:
file: .gitpod.DockerFile
tasks:
- command: npm install
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if (typeof process !== 'undefined' && parseInt(process.versions.node.split('.')[0]) < 14) {
if (typeof process !== 'undefined' && parseInt(process.versions.node.split('.')[0]) < 18) {
console.error('Your node version is currently', process.versions.node)
console.error('Please update it to a version >= 14.x.x from https://nodejs.org/')
console.error('Please update it to a version >= 18.x.x from https://nodejs.org/')
process.exit(1)
}

Expand Down
3 changes: 2 additions & 1 deletion test/externalTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ for (const supportedVersion of mineflayer.testedVersions) {
username: 'flatbot',
viewDistance: 'tiny',
port: PORT,
host: 'localhost',
host: '127.0.0.1',
version: supportedVersion
})
commonTest(bot)
Expand Down Expand Up @@ -89,6 +89,7 @@ for (const supportedVersion of mineflayer.testedVersions) {
console.log(`pinging ${version.minecraftVersion} port : ${PORT}`)
mc.ping({
port: PORT,
host: '127.0.0.1',
version: supportedVersion
}, (err, results) => {
if (err) return done(err)
Expand Down
2 changes: 1 addition & 1 deletion test/externalTests/plugins/testCommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function inject (bot) {
return run(childBotName)
}

const child = spawn('node', [file, 'localhost', `${bot.test.port}`])
const child = spawn('node', [file, '127.0.0.1', `${bot.test.port}`])

// Useful to debug child processes:
child.stdout.on('data', (data) => { console.log(`${data}`) })
Expand Down
2 changes: 1 addition & 1 deletion test/externalTests/spawnEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = () => async (bot) => {
username: 'spawnbot',
viewDistance: 'tiny',
port: bot.test.port,
host: 'localhost',
host: '127.0.0.1',
version: bot.version
})
await once(spawnBot, 'spawn')
Expand Down

0 comments on commit d3df34d

Please sign in to comment.