Skip to content

Commit

Permalink
chore(github-worklow): Add local setup-node action
Browse files Browse the repository at this point in the history
  • Loading branch information
kulla committed Jan 26, 2025
1 parent e415527 commit b530c98
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 8 deletions.
23 changes: 23 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Setup repository for CI tests
runs:
using: composite
steps:
- uses: actions/setup-node@v4
with:
node-version-file: .tool-versions

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
shell: bash

- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn --immutable
shell: bash
10 changes: 5 additions & 5 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: serlo/configure-repositories/actions/setup-node@main
- uses: ./.github/actions/setup-node
- run: yarn lint:eslint

prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: serlo/configure-repositories/actions/setup-node@main
- uses: ./.github/actions/setup-node
- run: yarn lint:prettier

tsc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: serlo/configure-repositories/actions/setup-node@main
- uses: ./.github/actions/setup-node
- run: yarn lint:tsc

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: serlo/configure-repositories/actions/setup-mysql@main
- uses: serlo/configure-repositories/actions/setup-node@main
- uses: ./.github/actions/setup-node
- run: yarn start:containers
- run: scripts/mysql/wait-for-mysql.sh
- run: yarn migrate:all
Expand All @@ -47,7 +47,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: serlo/configure-repositories/actions/setup-node@main
- uses: ./.github/actions/setup-node
- run: yarn codegen
- name: Check for uncommitted changes
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: serlo/configure-repositories/actions/setup-node@main
- uses: ./.github/actions/setup-node
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
build-args: |
image=${{ matrix.image }}
tags: api-${{ matrix.image }}-local-build:latest
- uses: serlo/configure-repositories/actions/setup-node@main
- uses: ./.github/actions/setup-node
- name: Start containers
run: yarn start:containers
- name: Wait until all containers are ready
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push-migration-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- uses: actions/checkout@v4
- uses: serlo/configure-repositories/actions/setup-node@main
- uses: ./.github/actions/setup-node
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand Down

0 comments on commit b530c98

Please sign in to comment.