Skip to content

Commit

Permalink
Tries to cache dependencies in the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ncordon committed Oct 19, 2023
1 parent d6c654b commit 8214b39
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 3 deletions.
10 changes: 10 additions & 0 deletions .github/actions/setup-node/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Setups node caching dependencies'

runs:
using: 'composite'
steps:
- name: Restore cache
uses: actions/setup-node@v3
with:
node-version: lts/Hydrogen
cache: 'npm'
28 changes: 28 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,34 @@ env:
NODE_OPTIONS: '--max_old_space_size=4096'

jobs:
cache-deps:
name: Install and cache dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup antlr4
uses: ./.github/actions/setup-antlr4

- name: Setup node cache
uses: ./.github/actions/setup-node

- name: Install dependencies with frozen lock file and generate parser
run: npm ci

lint-and-format:
name: Run eslint and check formatting
needs: cache-deps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup antlr4
uses: ./.github/actions/setup-antlr4

- name: Setup node cache
uses: ./.github/actions/setup-node

- name: Install dependencies with frozen lock file and generate parser
run: npm ci

Expand All @@ -38,10 +57,14 @@ jobs:
unit-test:
name: Unit tests
needs: cache-deps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup node cache
uses: ./.github/actions/setup-node

- name: Setup antlr4
uses: ./.github/actions/setup-antlr4

Expand All @@ -59,10 +82,15 @@ jobs:
e2e-test:
name: E2E tests
needs: cache-deps
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/Hydrogen
cache: 'npm'

- name: Setup antlr4
uses: ./.github/actions/setup-antlr4
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Setup node cache
uses: ./.github/actions/setup-node

- name: Setup Pages
uses: actions/configure-pages@v3

Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/publish-cypher-codemirror.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Setup node cache
uses: ./.github/actions/setup-node

- name: Setup antlr4
uses: ./.github/actions/setup-antlr4
Expand Down

0 comments on commit 8214b39

Please sign in to comment.