Improve CI with builtin checkout and gem caching
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.
This commit is contained in:
1 file changed
+19
-5
+19
-5
@@ -6,6 +6,10 @@ on:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ci-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
RAILS_ENV: test
|
||||
PGUSER: discourse
|
||||
@@ -22,13 +26,23 @@ jobs:
|
||||
- name: Set working directory owner
|
||||
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
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: pnpm install --frozen-lockfile --prefer-offline
|
||||
|
||||
- name: Bundle install
|
||||
run: bundle install
|
||||
run: |
|
||||
bundle config set --local path vendor/bundle
|
||||
bundle install
|
||||
|
||||
- name: Rubocop
|
||||
run: bundle exec rubocop .
|
||||
@@ -49,7 +63,7 @@ jobs:
|
||||
run: chown -R root:root .
|
||||
|
||||
- name: Checkout plugin
|
||||
uses: actions/checkout@v4
|
||||
uses: builtin:checkout
|
||||
with:
|
||||
path: plugin
|
||||
|
||||
@@ -119,7 +133,7 @@ jobs:
|
||||
|
||||
- name: Install JS dependencies
|
||||
working-directory: core
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: pnpm install --frozen-lockfile --prefer-offline
|
||||
|
||||
- name: Restore database from cache
|
||||
if: steps.app-cache.outputs.cache-hit == 'true'
|
||||
|
||||
Reference in new issue
Block a user