mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 07:04:52 +09:00
We have plans to support the latest version and one minor previous. 2.0 will be added to CI once enough changes have been made to support it.
57 lines
2.0 KiB
YAML
57 lines
2.0 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:
|
|
factorio-version: [1.1.110]
|
|
# Supported versions are latest stable/experimental and one minor version before stable (even if from a previous major)
|
|
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-frozen-lockfile
|
|
- name: Use Factorio ${{ matrix.factorio-version }}
|
|
run: wget -q -O factorio.tar.gz https://www.factorio.com/get-download/${{ matrix.factorio-version }}/headless/linux64 && tar -xf factorio.tar.gz && rm factorio.tar.gz
|
|
- name: Run tests
|
|
if: ${{ matrix.node-version != '18.x' || matrix.factorio-version != '1.1.110' }}
|
|
run: pnpm test
|
|
- name: Run coverage
|
|
if: ${{ matrix.node-version == '18.x' && matrix.factorio-version == '1.1.110' }}
|
|
run: pnpm run ci-cover
|
|
- name : Upload coverage to Codecov
|
|
if: ${{ matrix.node-version == '18.x' && matrix.factorio-version == '1.1.110' }}
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
files: ./coverage/lcov.info
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
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-frozen-lockfile
|
|
- run: pnpm run lint
|