mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
53 lines
1.6 KiB
YAML
53 lines
1.6 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: [18.x, 20.x]
|
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 8
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
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
|
|
- name: Run tests
|
|
if: ${{ matrix.node-version != '18.x' }}
|
|
run: pnpm test
|
|
- name: Run coverage
|
|
if: ${{ matrix.node-version == '18.x' }}
|
|
run: pnpm run ci-cover
|
|
- name : Upload coverage to Codecov
|
|
if: ${{ matrix.node-version == '18.x' }}
|
|
uses: codecov/codecov-action@v2
|
|
with:
|
|
files: ./coverage/lcov.info
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 8
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 18.x
|
|
- run: pnpm i --no-optional --no-frozen-lockfile
|
|
- run: pnpm run lint
|