ci: Enable caching

This commit is contained in:
Richard Hansen 2022-01-27 17:47:28 -05:00
parent 3732565f83
commit 63a02ec5fa
13 changed files with 105 additions and 10 deletions

View file

@ -14,10 +14,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2
with:
node-version: 12
- name: Install libreoffice
run: |
sudo add-apt-repository -y ppa:libreoffice/ppa
@ -47,6 +43,15 @@ jobs:
env:
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
- uses: actions/setup-node@v2
with:
node-version: 12
cache: 'npm'
cache-dependency-path: |
src/package-lock.json
src/bin/doc/package-lock.json
node_modules/${{ steps.plugin_name.outputs.plugin_name }}/package-lock.json
- name: Install plugin dependencies
run: |
cd ./node_modules/"${PLUGIN_NAME}"

View file

@ -15,15 +15,19 @@ jobs:
printf %s\\n '::set-output name=name::${{github.event.repository.name}} ${{ github.workflow }} - ${{ github.job }}'
printf %s\\n '::set-output name=tunnel_id::${{ github.run_id }}-${{ github.run_number }}-${{ github.job }}'
- uses: actions/setup-node@v2
with:
node-version: 12
- name: Check out Etherpad core
uses: actions/checkout@v2
with:
repository: ether/etherpad-lite
- uses: actions/setup-node@v2
with:
node-version: 12
cache: 'npm'
cache-dependency-path: |
src/package-lock.json
src/bin/doc/package-lock.json
- name: Check out the plugin
uses: actions/checkout@v2
with:

View file

@ -29,9 +29,20 @@ jobs:
# etherpad-lite has been moved outside of $GITHUB_WORKSPACE, so it is now
# safe to clone this plugin's repo to $GITHUB_WORKSPACE.
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
# This is necessary for actions/setup-node because '..' can't be used in
# cache-dependency-path.
- name: Create ep_etherpad-lite symlink
run: |
mkdir -p node_modules
ln -s ../../etherpad-lite/src node_modules/ep_etherpad-lite
- uses: actions/setup-node@v2
with:
node-version: 12
cache: 'npm'
cache-dependency-path: |
node_modules/ep_etherpad-lite/package-lock.json
node_modules/ep_etherpad-lite/bin/doc/package-lock.json
package-lock.json
# All of ep_etherpad-lite's devDependencies are installed because the
# plugin might do `require('ep_etherpad-lite/node_modules/${devDep}')`.
# Eventually it would be nice to create an ESLint plugin that prohibits
@ -58,10 +69,11 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: 12
registry-url: https://registry.npmjs.org/
cache: 'npm'
- name: Bump version (patch)
run: |
LATEST_TAG=$(git describe --tags --abbrev=0) || exit 1