1 Commits
Author SHA1 Message Date
raucao f2b7f1992a Improve CI with builtin checkout and gem caching
CI / lint (push) Successful in 2m10s
CI / tests (push) Successful in 7m49s
Use the runner's builtin:checkout so jobs need no action download or
Node for checkout, cancel superseded runs with concurrency, cache the
plugin's gems in the lint job, and prefer the pnpm store.
2026-11-05 16:47:29 +04:00
+19 -5
View File
@@ -6,6 +6,10 @@ on:
- main - main
pull_request: pull_request:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env: env:
RAILS_ENV: test RAILS_ENV: test
PGUSER: discourse PGUSER: discourse
@@ -22,13 +26,23 @@ jobs:
- name: Set working directory owner - name: Set working directory owner
run: chown -R root:root . run: chown -R root:root .
- uses: actions/checkout@v4 - uses: builtin:checkout
- name: Cache gems
uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-lint-gems-${{ hashFiles('Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-lint-gems-
- name: Install JS dependencies - name: Install JS dependencies
run: pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile --prefer-offline
- name: Bundle install - name: Bundle install
run: bundle install run: |
bundle config set --local path vendor/bundle
bundle install
- name: Rubocop - name: Rubocop
run: bundle exec rubocop . run: bundle exec rubocop .
@@ -49,7 +63,7 @@ jobs:
run: chown -R root:root . run: chown -R root:root .
- name: Checkout plugin - name: Checkout plugin
uses: actions/checkout@v4 uses: builtin:checkout
with: with:
path: plugin path: plugin
@@ -119,7 +133,7 @@ jobs:
- name: Install JS dependencies - name: Install JS dependencies
working-directory: core working-directory: core
run: pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile --prefer-offline
- name: Restore database from cache - name: Restore database from cache
if: steps.app-cache.outputs.cache-hit == 'true' if: steps.app-cache.outputs.cache-hit == 'true'