Skip to content

Commit

Permalink
setup yarn cache in Github Actions (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
baruchiro authored Sep 26, 2023
1 parent 96521cd commit b11d8e3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Node CI
on:
pull_request:
paths-ignore:
- "nuxt/**"
- 'nuxt/**'

jobs:
lint:
Expand All @@ -14,7 +14,9 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 14.x
- run: yarn
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- run: yarn --network-timeout 100000
- run: yarn lint
- name: Type check
run: |
Expand All @@ -41,14 +43,16 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- name: Install xvfb
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install -y xvfb graphicsmagick
npm install -g xvfb-maybe
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- run: yarn
- run: yarn --network-timeout 100000
- run: yarn unit
- run: yarn e2e
- name: Upload screenshots
Expand Down Expand Up @@ -78,7 +82,9 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 14.x
- run: yarn
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- run: yarn --network-timeout 100000
- name: Build Electron app
shell: bash
env:
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/nuxt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name: Test and Deploy Github Pages with Nuxt
on:
pull_request:
paths:
- "nuxt/**"
- ".github/workflows/*nuxt*.yml"
- 'nuxt/**'
- '.github/workflows/*nuxt*.yml'
push:
branches: master
paths:
- "nuxt/**"
- ".github/workflows/*nuxt*.yml"
- 'nuxt/**'
- '.github/workflows/*nuxt*.yml'

jobs:
test:
Expand All @@ -22,6 +22,8 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'yarn'
cache-dependency-path: 'nuxt/yarn.lock'
- run: yarn
- run: yarn lint
- run: yarn test
Expand All @@ -38,6 +40,8 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'yarn'
cache-dependency-path: 'nuxt/yarn.lock'
- name: yarn
run: yarn
- name: deploy
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ on:
workflow_dispatch:
inputs:
version:
description: "Exsiting version to publish files. If not provided, will create a new release."
description: 'Exsiting version to publish files. If not provided, will create a new release.'
required: false
type: string
push:
branches:
- master
paths-ignore:
- "nuxt/**"
- 'nuxt/**'

jobs:
release:
Expand All @@ -23,7 +23,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- run: yarn
- run: yarn --network-timeout 100000
- uses: cycjimmy/semantic-release-action@8f6ceb9d5aae5578b1dcda6af00008235204e7fa
id: semantic
if: inputs.version == ''
Expand All @@ -50,6 +50,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@06f69b882c878790b568f0247d623eaa49de2f3d
# Only install Snapcraft on Ubuntu
Expand All @@ -60,7 +62,7 @@ jobs:
snapcraft_token: ${{ secrets.snapcraft_token }}
- name: set version
run: yarn version --no-git-tag-version --new-version ${{ env.NEW_RELEASE_VERSION }}
- run: yarn
- run: yarn --network-timeout 100000
- name: Build & release Electron app
shell: bash
env:
Expand Down

0 comments on commit b11d8e3

Please sign in to comment.