mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 07:43:12 +09:00
Merge pull request #1158 from bbassie/ci/setup-speed
Speed up CI setup and the coverage upload
This commit is contained in:
3 files changed
+18
-33
No files matched your search
@@ -1,5 +1,5 @@
|
|||||||
name: Install dependencies
|
name: Install dependencies
|
||||||
description: Set up pnpm and Node.js, restore caches and run pnpm install
|
description: Set up pnpm and Node.js and run pnpm install
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
node-version:
|
node-version:
|
||||||
@@ -12,40 +12,15 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- uses: pnpm/action-setup@v6
|
|
||||||
- uses: actions/setup-node@v7
|
- uses: actions/setup-node@v7
|
||||||
with:
|
with:
|
||||||
node-version: ${{ inputs.node-version }}
|
node-version: ${{ inputs.node-version }}
|
||||||
|
package-manager-cache: false
|
||||||
|
|
||||||
# The lockfile is not committed, so the usual lockfile hash key does not
|
# pnpm/action-setup installs a bootstrap pnpm and then switches to the
|
||||||
# apply. Instead a new store snapshot is saved whenever a package.json
|
# packageManager version, which takes about 10 seconds.
|
||||||
# changes or a week passes, and every run restores the most recent one.
|
- shell: bash
|
||||||
- id: store
|
run: npm install --global --no-audit --no-fund "$(node -p 'require("./package.json").packageManager.split("+")[0]')"
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "week=$(date -u +%G-%V)" >> "$GITHUB_OUTPUT"
|
|
||||||
- uses: actions/cache@v6
|
|
||||||
with:
|
|
||||||
path: ${{ steps.store.outputs.path }}
|
|
||||||
key: pnpm-store-${{ runner.os }}-${{ steps.store.outputs.week }}-${{ hashFiles('**/package.json', 'pnpm-workspace.yaml') }}
|
|
||||||
restore-keys: pnpm-store-${{ runner.os }}-
|
|
||||||
|
|
||||||
# The prepare scripts run tsc --build, which is incremental when its
|
|
||||||
# previous output is present. Every run saves its output and the next run
|
|
||||||
# starts from the most recent one.
|
|
||||||
- if: inputs.ignore-scripts != 'true'
|
|
||||||
uses: actions/cache@v6
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
packages/*/dist
|
|
||||||
plugins/*/dist
|
|
||||||
key: build-${{ runner.os }}-${{ github.sha }}
|
|
||||||
restore-keys: build-${{ runner.os }}-
|
|
||||||
|
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: pnpm i --no-frozen-lockfile ${{ inputs.ignore-scripts == 'true' && '--ignore-scripts' || '' }}
|
run: pnpm i --no-frozen-lockfile ${{ inputs.ignore-scripts == 'true' && '--ignore-scripts' || '' }}
|
||||||
# Drop packages the restored store had but this install did not use, so
|
|
||||||
# the snapshot does not grow with every version bump.
|
|
||||||
- shell: bash
|
|
||||||
run: pnpm store prune
|
|
||||||
@@ -4,6 +4,10 @@ on:
|
|||||||
push:
|
push:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
EMMYLUA_CHECK_VERSION: "0.25.1"
|
EMMYLUA_CHECK_VERSION: "0.25.1"
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,12 @@ on:
|
|||||||
push:
|
push:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
|
# Superseded runs of a branch or pull request are cancelled. Runs on master
|
||||||
|
# each get their own group so every commit there is tested.
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NODE_VERSION: 24.x
|
NODE_VERSION: 24.x
|
||||||
|
|
||||||
@@ -54,6 +60,8 @@ jobs:
|
|||||||
uses: codecov/codecov-action@v7
|
uses: codecov/codecov-action@v7
|
||||||
with:
|
with:
|
||||||
files: ./coverage/lcov.info
|
files: ./coverage/lcov.info
|
||||||
|
# Otherwise the raw V8 coverage in coverage/tmp is uploaded as well
|
||||||
|
disable_search: true
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
- name: Upload test logs for debugging
|
- name: Upload test logs for debugging
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
@@ -87,8 +95,6 @@ jobs:
|
|||||||
uses: ./.github/actions/pnpm-install
|
uses: ./.github/actions/pnpm-install
|
||||||
with:
|
with:
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
- name: Build
|
|
||||||
run: pnpm run build
|
|
||||||
- name: Test ${{ matrix.controller }} controller with ${{ matrix.host }} host
|
- name: Test ${{ matrix.controller }} controller with ${{ matrix.host }} host
|
||||||
run: >
|
run: >
|
||||||
node scripts/version-compat-test.js
|
node scripts/version-compat-test.js
|
||||||
|
|||||||
Reference in new issue
Block a user