mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 07:04:52 +09:00
The role of a slave as a host for Factorio servers is not well reflected in its name and has caused confusion among users. Rename slave to host to better reflect its role as a host of Factorio servers.
55 lines
1.9 KiB
YAML
55 lines
1.9 KiB
YAML
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
|
|
name: Node.js CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [12.x, 14.x, 16.x]
|
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: pnpm/action-setup@v2.2.2
|
|
with:
|
|
version: 6
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- run: pnpm i --no-optional --no-frozen-lockfile
|
|
- run: wget -q -O factorio.tar.gz https://www.factorio.com/get-download/latest/headless/linux64 && tar -xf factorio.tar.gz && rm factorio.tar.gz
|
|
- run: node packages/lib/build_mod --source-dir packages/host/lua/clusterio_lib --output-dir temp/test/mods
|
|
- run: wget -q -O temp/test/mods/subspace_storage_1.99.8.zip -L https://github.com/clusterio/subspace_storage/releases/download/1.99.6/subspace_storage_1.99.8.zip
|
|
- name: Run tests
|
|
if: ${{ matrix.node-version != '12.x' }}
|
|
run: pnpm test
|
|
- name: Run coverage
|
|
if: ${{ matrix.node-version == '12.x' }}
|
|
run: pnpm run ci-cover
|
|
- name : Upload coverage to Codecov
|
|
if: ${{ matrix.node-version == '12.x' }}
|
|
uses: codecov/codecov-action@v2
|
|
with:
|
|
files: ./coverage/lcov.info
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: pnpm/action-setup@v2.2.2
|
|
with:
|
|
version: 6
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 16.x
|
|
- run: pnpm i --no-optional --no-frozen-lockfile
|
|
- run: pnpm run lint
|