2021-06-16 08:52:44 +02:00
|
|
|
name: e2e-cache
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
2021-06-25 11:06:49 +02:00
|
|
|
- '**.md'
|
|
|
|
push:
|
2021-06-16 08:52:44 +02:00
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- releases/*
|
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
2022-04-01 10:13:52 +02:00
|
|
|
|
2021-06-16 08:52:44 +02:00
|
|
|
jobs:
|
|
|
|
node-npm-depencies-caching:
|
|
|
|
name: Test npm (Node ${{ matrix.node-version}}, ${{ matrix.os }})
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
2024-05-22 15:12:24 +02:00
|
|
|
node-version: [18, 20, 22]
|
2021-06-16 08:52:44 +02:00
|
|
|
steps:
|
2023-10-23 16:22:01 +02:00
|
|
|
- uses: actions/checkout@v4
|
2021-06-16 08:52:44 +02:00
|
|
|
- name: Clean global cache
|
|
|
|
run: npm cache clean --force
|
|
|
|
- name: Setup Node
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
|
|
run: npm install
|
|
|
|
- name: Verify node and npm
|
|
|
|
run: __tests__/verify-node.sh "${{ matrix.node-version }}"
|
|
|
|
shell: bash
|
2021-06-30 17:44:51 +02:00
|
|
|
|
|
|
|
node-pnpm-depencies-caching:
|
|
|
|
name: Test pnpm (Node ${{ matrix.node-version}}, ${{ matrix.os }})
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
2024-05-22 15:12:24 +02:00
|
|
|
node-version: [18, 20, 22]
|
2021-06-30 17:44:51 +02:00
|
|
|
steps:
|
2023-10-23 16:22:01 +02:00
|
|
|
- uses: actions/checkout@v4
|
2021-06-30 17:44:51 +02:00
|
|
|
- name: Install pnpm
|
|
|
|
uses: pnpm/action-setup@v2
|
|
|
|
with:
|
2021-07-15 13:51:41 +02:00
|
|
|
version: 6.10.0
|
2021-06-30 17:44:51 +02:00
|
|
|
- name: Generate pnpm file
|
|
|
|
run: pnpm install
|
|
|
|
- name: Remove dependencies
|
|
|
|
shell: pwsh
|
|
|
|
run: Remove-Item node_modules -Force -Recurse
|
|
|
|
- name: Clean global cache
|
|
|
|
run: rm -rf ~/.pnpm-store
|
|
|
|
shell: bash
|
|
|
|
- name: Setup Node
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
cache: 'pnpm'
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install
|
|
|
|
- name: Verify node and pnpm
|
|
|
|
run: __tests__/verify-node.sh "${{ matrix.node-version }}"
|
|
|
|
shell: bash
|
2021-06-16 08:52:44 +02:00
|
|
|
|
|
|
|
node-yarn1-depencies-caching:
|
|
|
|
name: Test yarn 1 (Node ${{ matrix.node-version}}, ${{ matrix.os }})
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
2024-05-22 15:12:24 +02:00
|
|
|
node-version: [18, 20]
|
2021-06-16 08:52:44 +02:00
|
|
|
steps:
|
2023-10-23 16:22:01 +02:00
|
|
|
- uses: actions/checkout@v4
|
2021-06-16 08:52:44 +02:00
|
|
|
- name: Yarn version
|
|
|
|
run: yarn --version
|
|
|
|
- name: Generate yarn file
|
|
|
|
run: yarn install
|
|
|
|
- name: Remove dependencies
|
|
|
|
shell: pwsh
|
|
|
|
run: Remove-Item node_modules -Force -Recurse
|
|
|
|
- name: Clean global cache
|
|
|
|
run: yarn cache clean
|
|
|
|
- name: Setup Node
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
cache: 'yarn'
|
|
|
|
- name: Install dependencies
|
2023-11-10 15:16:46 +01:00
|
|
|
run: yarn install --ignore-engines
|
2021-06-16 08:52:44 +02:00
|
|
|
- name: Verify node and yarn
|
|
|
|
run: __tests__/verify-node.sh "${{ matrix.node-version }}"
|
|
|
|
shell: bash
|
|
|
|
|
2023-10-23 12:20:07 +02:00
|
|
|
node-yarn3-depencies-caching:
|
|
|
|
name: Test yarn 3 (Node ${{ matrix.node-version}}, ${{ matrix.os }})
|
2021-06-16 08:52:44 +02:00
|
|
|
runs-on: ${{ matrix.os }}
|
2021-08-03 17:53:52 +02:00
|
|
|
env:
|
|
|
|
YARN_ENABLE_IMMUTABLE_INSTALLS: false
|
2021-06-16 08:52:44 +02:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
2024-05-22 15:12:24 +02:00
|
|
|
node-version: [18, 20, 22]
|
2021-06-16 08:52:44 +02:00
|
|
|
steps:
|
2023-10-23 16:22:01 +02:00
|
|
|
- uses: actions/checkout@v4
|
2021-06-16 08:52:44 +02:00
|
|
|
- name: Update yarn
|
2023-10-23 12:20:07 +02:00
|
|
|
run: yarn set version 3.6.4
|
2021-06-16 08:52:44 +02:00
|
|
|
- name: Yarn version
|
|
|
|
run: yarn --version
|
|
|
|
- name: Generate simple .yarnrc.yml
|
|
|
|
run: |
|
|
|
|
echo "nodeLinker: node-modules" >> .yarnrc.yml
|
|
|
|
- name: Generate yarn file
|
|
|
|
run: yarn install
|
|
|
|
- name: Remove dependencies
|
|
|
|
shell: pwsh
|
|
|
|
run: Remove-Item node_modules -Force -Recurse
|
|
|
|
- name: Clean global cache
|
|
|
|
run: yarn cache clean --all
|
|
|
|
- name: Setup Node
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
cache: 'yarn'
|
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn install
|
|
|
|
- name: Verify node and yarn
|
|
|
|
run: __tests__/verify-node.sh "${{ matrix.node-version }}"
|
2021-07-15 13:51:41 +02:00
|
|
|
shell: bash
|
2023-06-21 17:52:17 +02:00
|
|
|
|
|
|
|
yarn-subprojects:
|
|
|
|
name: Test yarn subprojects
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-05-22 15:12:24 +02:00
|
|
|
node-version: [18, 20, 22]
|
2023-06-21 17:52:17 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2023-10-23 16:22:01 +02:00
|
|
|
- uses: actions/checkout@v4
|
2023-06-21 17:52:17 +02:00
|
|
|
|
|
|
|
- name: prepare sub-projects
|
2023-06-27 13:07:43 +02:00
|
|
|
run: __tests__/prepare-yarn-subprojects.sh yarn1
|
2023-06-21 17:52:17 +02:00
|
|
|
|
|
|
|
# expect
|
|
|
|
# - no errors
|
|
|
|
# - log
|
|
|
|
# ##[debug]Cache Paths:
|
|
|
|
# ##[debug]["sub2/.yarn/cache","sub3/.yarn/cache","../../../.cache/yarn/v6"]
|
|
|
|
- name: Setup Node
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
cache: 'yarn'
|
|
|
|
cache-dependency-path: |
|
|
|
|
**/*.lock
|
|
|
|
yarn.lock
|
2023-06-27 13:07:43 +02:00
|
|
|
|
|
|
|
yarn-subprojects-berry-local:
|
|
|
|
name: Test yarn subprojects all locally managed
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-05-22 15:12:24 +02:00
|
|
|
node-version: [18, 20, 22]
|
2023-06-27 13:07:43 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2023-10-23 16:22:01 +02:00
|
|
|
- uses: actions/checkout@v4
|
2023-06-27 13:07:43 +02:00
|
|
|
|
|
|
|
- name: prepare sub-projects
|
2023-07-13 14:03:41 +02:00
|
|
|
run: __tests__/prepare-yarn-subprojects.sh keepcache keepcache
|
2023-06-27 13:07:43 +02:00
|
|
|
|
|
|
|
# expect
|
|
|
|
# - no errors
|
|
|
|
# - log
|
|
|
|
# ##[info]All dependencies are managed locally by yarn3, the previous cache can be used
|
|
|
|
# ##[debug]["node-cache-Linux-yarn-401024703386272f1a950c9f014cbb1bb79a7a5b6e1fb00e8b90d06734af41ee","node-cache-Linux-yarn"]
|
|
|
|
- name: Setup Node
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
cache: 'yarn'
|
|
|
|
cache-dependency-path: |
|
|
|
|
sub2/*.lock
|
|
|
|
sub3/*.lock
|
|
|
|
|
|
|
|
yarn-subprojects-berry-global:
|
|
|
|
name: Test yarn subprojects some locally managed
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-05-22 15:12:24 +02:00
|
|
|
node-version: [18, 20, 22]
|
2023-06-27 13:07:43 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2023-10-23 16:22:01 +02:00
|
|
|
- uses: actions/checkout@v4
|
2023-06-27 13:07:43 +02:00
|
|
|
|
|
|
|
- name: prepare sub-projects
|
|
|
|
run: __tests__/prepare-yarn-subprojects.sh global
|
|
|
|
|
|
|
|
# expect
|
|
|
|
# - no errors
|
|
|
|
# - log must
|
|
|
|
# ##[debug]"/home/runner/work/setup-node-test/setup-node-test/sub2" dependencies are managed by yarn 3 locally
|
|
|
|
# ##[debug]"/home/runner/work/setup-node-test/setup-node-test/sub3" dependencies are not managed by yarn 3 locally
|
|
|
|
- name: Setup Node
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
cache: 'yarn'
|
|
|
|
cache-dependency-path: |
|
|
|
|
sub2/*.lock
|
|
|
|
sub3/*.lock
|
|
|
|
|
|
|
|
yarn-subprojects-berry-git:
|
|
|
|
name: Test yarn subprojects managed by git
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-05-22 15:12:24 +02:00
|
|
|
node-version: [18, 20, 22]
|
2023-06-27 13:07:43 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2023-10-23 16:22:01 +02:00
|
|
|
- uses: actions/checkout@v4
|
2023-06-27 13:07:43 +02:00
|
|
|
|
|
|
|
- name: prepare sub-projects
|
|
|
|
run: /bin/bash __tests__/prepare-yarn-subprojects.sh keepcache
|
|
|
|
|
|
|
|
# expect
|
|
|
|
# - no errors
|
|
|
|
# - log
|
|
|
|
# [debug]"/home/runner/work/setup-node-test/setup-node-test/sub2" has .yarn/cache - dependencies are kept in the repository
|
|
|
|
# [debug]"/home/runner/work/setup-node-test/setup-node-test/sub3" has .yarn/cache - dependencies are kept in the repository
|
|
|
|
# [debug]["node-cache-Linux-yarn-401024703386272f1a950c9f014cbb1bb79a7a5b6e1fb00e8b90d06734af41ee"]
|
|
|
|
- name: Setup Node
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
cache: 'yarn'
|
|
|
|
cache-dependency-path: |
|
|
|
|
sub2/*.lock
|
|
|
|
sub3/*.lock
|