ci: switch to self-hosted runners

This commit is contained in:
djkazic 2026-07-22 11:33:12 -04:00
parent ec6814e940
commit 08deb22ca3
4 changed files with 45 additions and 20 deletions

View file

@ -3,7 +3,8 @@ description: "A reusable workflow that's used to set up the Node environment and
inputs:
node-version:
description: "The version of Node to set up"
required: true
required: false
default: "16.x"
runs:
using: "composite"
@ -15,10 +16,37 @@ runs:
git config --global core.eol lf
git config --global core.autocrlf false
- name: setup nodejs v${{ inputs.node-version }}
- name: resolve node version
id: node-version
shell: bash
# Several jobs pass `${{ matrix.node_version }}` without defining it in
# their matrix, which resolves to an empty string and makes
# actions/setup-node a no-op (falling back to the runner's system Node).
# Fall back to the default when no version is provided.
run: |
version="${{ inputs.node-version }}"
if [ -z "$version" ]; then
version="16.x"
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: setup nodejs v${{ steps.node-version.outputs.version }}
uses: actions/setup-node@v3
with:
node-version: '${{ inputs.node-version }}'
node-version: '${{ steps.node-version.outputs.version }}'
- name: install yarn
shell: bash
# The self-hosted runners don't ship yarn, and the system Node install
# lives in a root-owned prefix, so a global `npm install -g` fails with
# EACCES. Install into a home-directory prefix instead and expose it on
# PATH for the following steps.
run: |
if ! command -v yarn >/dev/null 2>&1; then
npm config set prefix "$HOME/.npm-global"
npm install -g yarn
echo "$HOME/.npm-global/bin" >> "$GITHUB_PATH"
fi
- name: get yarn cache dir
id: yarn-cache-dir
@ -30,8 +58,8 @@ runs:
id: yarn-cache
with:
path: ${{ env.YARN_CACHE_DIR }}
key: litd-${{ runner.os }}-yarn-${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}
key: litd-${{ runner.os }}-yarn-${{ steps.node-version.outputs.version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
litd-${{ runner.os }}-yarn-${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}
litd-${{ runner.os }}-yarn-${{ inputs.node-version }}-
litd-${{ runner.os }}-yarn-${{ steps.node-version.outputs.version }}-${{ hashFiles('**/yarn.lock') }}
litd-${{ runner.os }}-yarn-${{ steps.node-version.outputs.version }}-
litd-${{ runner.os }}-yarn-

View file

@ -17,7 +17,7 @@ jobs:
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
runs-on: [self-hosted]
permissions:
contents: read
pull-requests: read

View file

@ -23,7 +23,7 @@ env:
jobs:
main:
runs-on: ubuntu-latest
runs-on: [self-hosted]
steps:
- name: cleanup space
uses: ./.github/actions/cleanup-space

View file

@ -102,7 +102,7 @@ jobs:
########################
cross-compile:
name: cross compilation
runs-on: ubuntu-latest
runs-on: [self-hosted]
strategy:
fail-fast: true
matrix:
@ -115,9 +115,6 @@ jobs:
- name: arm
sys: darwin-arm64 linux-armv6 linux-armv7 linux-arm64
steps:
- name: cleanup space
run: rm -rf /opt/hostedtoolcache
- name: git checkout
uses: actions/checkout@v4
@ -134,7 +131,7 @@ jobs:
########################
proto-compile-check:
name: RPC proto compilation check
runs-on: ubuntu-latest
runs-on: [self-hosted]
steps:
- name: git checkout
uses: actions/checkout@v4
@ -170,7 +167,7 @@ jobs:
check-commits:
if: github.event_name == 'pull_request'
name: check commits
runs-on: ubuntu-latest
runs-on: [self-hosted]
steps:
- name: git checkout
uses: actions/checkout@v4
@ -198,7 +195,7 @@ jobs:
#######################
sqlc-check:
name: Sqlc check
runs-on: ubuntu-latest
runs-on: [self-hosted]
steps:
- name: git checkout
uses: actions/checkout@v3
@ -220,7 +217,7 @@ jobs:
########################
lint:
name: lint
runs-on: ubuntu-latest
runs-on: [self-hosted]
steps:
- name: git checkout
uses: actions/checkout@v4
@ -243,7 +240,7 @@ jobs:
########################
unit-test:
name: run unit tests
runs-on: ubuntu-latest
runs-on: [self-hosted]
strategy:
# Allow other tests in the matrix to continue if one fails.
fail-fast: false
@ -272,7 +269,7 @@ jobs:
########################
build-itest:
name: build itest binaries
runs-on: ubuntu-latest
runs-on: [self-hosted]
steps:
- name: git checkout
uses: actions/checkout@v4
@ -296,7 +293,7 @@ jobs:
########################
itest:
name: integration test
runs-on: ubuntu-latest
runs-on: [self-hosted]
needs: build-itest
strategy:
# Allow other tests in the matrix to continue if one fails.
@ -358,7 +355,7 @@ jobs:
########################
release-notes-check:
name: check release notes updated
runs-on: ubuntu-latest
runs-on: [self-hosted]
if: '!contains(github.event.pull_request.labels.*.name, ''no-changelog'')'
steps:
- name: git checkout