From f3c66b06f130b5860de40296986c2997f41b9cd6 Mon Sep 17 00:00:00 2001 From: Stephan Kulla Date: Sun, 26 Jan 2025 23:37:32 +0100 Subject: [PATCH 1/4] chore(yarn): Remove zero-install --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 5a4bebdbb..301c7d7ab 100644 --- a/.gitignore +++ b/.gitignore @@ -82,9 +82,9 @@ dist/ .idea .vscode -# Yarn (with Zero-Installs) +# Yarn (without PnP and zero-installs) +.pnp.* .yarn/* -!.yarn/cache !.yarn/patches !.yarn/plugins !.yarn/releases From ff17efb256b6190b37a0bbdf7b2f7902cf255952 Mon Sep 17 00:00:00 2001 From: Stephan Kulla Date: Sun, 26 Jan 2025 23:42:12 +0100 Subject: [PATCH 2/4] chore(github-workflow): Remove "yarn" workflow --- .github/workflows/checks.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index eb721725f..d10c75053 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -6,13 +6,6 @@ on: pull_request: merge_group: jobs: - yarn: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: serlo/configure-repositories/actions/setup-node@main - - run: yarn --check-cache - eslint: runs-on: ubuntu-latest steps: From c9841ede52315f10acac0afc0d077116d3bf0917 Mon Sep 17 00:00:00 2001 From: Stephan Kulla Date: Sun, 26 Jan 2025 23:46:02 +0100 Subject: [PATCH 3/4] chore(github-worklow): Add local setup-node action --- .github/actions/setup-node/action.yml | 23 ++++++++++++++++++++++ .github/workflows/checks.yml | 10 +++++----- .github/workflows/deploy.yml | 2 +- .github/workflows/docker.yml | 2 +- .github/workflows/push-migration-image.yml | 2 +- 5 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 .github/actions/setup-node/action.yml diff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.yml new file mode 100644 index 000000000..3e23391ed --- /dev/null +++ b/.github/actions/setup-node/action.yml @@ -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 diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index d10c75053..2059c6977 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -10,21 +10,21 @@ 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: @@ -32,7 +32,7 @@ jobs: 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 @@ -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: | diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 344e83e1e..d9575aa9d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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: diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index eaec4ba9a..9defa6755 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -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 diff --git a/.github/workflows/push-migration-image.yml b/.github/workflows/push-migration-image.yml index 3872bad95..fbe6b03fc 100644 --- a/.github/workflows/push-migration-image.yml +++ b/.github/workflows/push-migration-image.yml @@ -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: From 4dd5d9c71aa91643565c156693c65f03b279fa88 Mon Sep 17 00:00:00 2001 From: Stephan Kulla Date: Sun, 26 Jan 2025 23:48:41 +0100 Subject: [PATCH 4/4] fix(Dockerfile): Remove "--immutable-cache" --- packages/server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/Dockerfile b/packages/server/Dockerfile index c5e8abe15..722433c08 100644 --- a/packages/server/Dockerfile +++ b/packages/server/Dockerfile @@ -13,7 +13,7 @@ COPY lerna.json . COPY yarn.lock . FROM base AS build_dist -RUN yarn --immutable --immutable-cache --silent +RUN yarn --immutable --silent COPY packages/authorization packages/authorization COPY packages/server packages/server RUN yarn build:${image}