2019-10-01 15:08:40 -05:00
|
|
|
name: CI
|
|
|
|
|
2020-06-30 14:55:14 -05:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
paths:
|
2020-09-07 00:36:08 -05:00
|
|
|
- .changeset/**
|
2020-06-30 14:55:14 -05:00
|
|
|
- .github/workflows/ci.yml
|
2020-09-01 14:22:36 -05:00
|
|
|
- 'packages/**'
|
2022-08-03 01:01:27 -05:00
|
|
|
- 'test/**'
|
2021-12-29 13:23:20 -05:00
|
|
|
- 'docker-examples/**'
|
2020-09-01 14:22:36 -05:00
|
|
|
- 'jest/**'
|
|
|
|
- 'package.json'
|
|
|
|
- 'pnpm-workspace.yaml'
|
2022-04-28 11:06:00 -05:00
|
|
|
permissions:
|
|
|
|
contents: read
|
2024-03-23 05:32:13 -05:00
|
|
|
concurrency:
|
|
|
|
group: ci-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
2022-04-28 11:06:00 -05:00
|
|
|
|
2019-10-01 15:08:40 -05:00
|
|
|
jobs:
|
2021-04-24 16:28:52 -05:00
|
|
|
prepare:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: setup verdaccio
|
|
|
|
services:
|
|
|
|
verdaccio:
|
2024-10-20 12:26:36 -05:00
|
|
|
image: verdaccio/verdaccio:6
|
2021-04-24 16:28:52 -05:00
|
|
|
ports:
|
|
|
|
- 4873:4873
|
2022-09-18 14:47:23 -05:00
|
|
|
env:
|
2023-10-23 14:49:18 -05:00
|
|
|
NODE_ENV: production
|
2021-04-24 16:28:52 -05:00
|
|
|
steps:
|
2024-11-02 04:02:18 -05:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2023-10-23 14:49:18 -05:00
|
|
|
- name: Node
|
2024-11-02 05:38:10 -05:00
|
|
|
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
2023-10-23 14:49:18 -05:00
|
|
|
with:
|
|
|
|
node-version-file: '.nvmrc'
|
|
|
|
- name: Install pnpm
|
|
|
|
run: |
|
|
|
|
corepack enable
|
|
|
|
corepack install
|
|
|
|
- name: set store
|
|
|
|
run: |
|
|
|
|
mkdir ~/.pnpm-store
|
|
|
|
pnpm config set store-dir ~/.pnpm-store
|
|
|
|
- name: Install
|
|
|
|
run: pnpm install --registry http://localhost:4873
|
|
|
|
- name: Cache .pnpm-store
|
2024-11-02 06:01:14 -05:00
|
|
|
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2
|
2023-10-23 14:49:18 -05:00
|
|
|
with:
|
|
|
|
path: ~/.pnpm-store
|
|
|
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
pnpm-
|
2021-04-24 16:28:52 -05:00
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Lint
|
|
|
|
needs: prepare
|
|
|
|
steps:
|
2024-11-02 04:02:18 -05:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2022-09-18 14:47:23 -05:00
|
|
|
- name: Node
|
2024-11-02 05:38:10 -05:00
|
|
|
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
2021-04-24 16:28:52 -05:00
|
|
|
with:
|
2022-09-18 14:47:23 -05:00
|
|
|
node-version-file: '.nvmrc'
|
2021-04-24 16:28:52 -05:00
|
|
|
- name: Install pnpm
|
2022-11-12 16:05:08 -05:00
|
|
|
run: |
|
|
|
|
corepack enable
|
2023-10-23 14:49:18 -05:00
|
|
|
corepack install
|
2024-11-02 06:01:14 -05:00
|
|
|
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2
|
2021-04-24 16:28:52 -05:00
|
|
|
with:
|
|
|
|
path: ~/.pnpm-store
|
2021-12-29 13:23:20 -05:00
|
|
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
2023-04-12 01:23:01 -05:00
|
|
|
- name: set store
|
|
|
|
run: |
|
2023-10-23 14:49:18 -05:00
|
|
|
pnpm config set store-dir ~/.pnpm-store
|
2021-04-24 16:28:52 -05:00
|
|
|
- name: Install
|
2023-08-21 14:16:12 -05:00
|
|
|
run: pnpm install --ignore-scripts
|
2021-04-24 16:28:52 -05:00
|
|
|
- name: Lint
|
|
|
|
run: pnpm lint
|
|
|
|
format:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Format
|
|
|
|
needs: prepare
|
|
|
|
steps:
|
2024-11-02 04:02:18 -05:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2022-09-18 14:47:23 -05:00
|
|
|
- name: Use Node
|
2024-11-02 05:38:10 -05:00
|
|
|
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
2021-04-24 16:28:52 -05:00
|
|
|
with:
|
2022-09-18 14:47:23 -05:00
|
|
|
node-version-file: '.nvmrc'
|
2021-04-24 16:28:52 -05:00
|
|
|
- name: Install pnpm
|
2022-11-12 16:05:08 -05:00
|
|
|
run: |
|
|
|
|
corepack enable
|
2023-10-23 14:49:18 -05:00
|
|
|
corepack install
|
2024-11-02 06:01:14 -05:00
|
|
|
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2
|
2021-04-24 16:28:52 -05:00
|
|
|
with:
|
|
|
|
path: ~/.pnpm-store
|
2021-12-29 13:23:20 -05:00
|
|
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
2023-04-12 01:23:01 -05:00
|
|
|
- name: set store
|
|
|
|
run: |
|
2023-10-23 14:49:18 -05:00
|
|
|
pnpm config set store-dir ~/.pnpm-store
|
2021-04-24 16:28:52 -05:00
|
|
|
- name: Install
|
2023-08-21 14:16:12 -05:00
|
|
|
run: pnpm install --ignore-scripts
|
2021-04-24 16:28:52 -05:00
|
|
|
- name: Lint
|
|
|
|
run: pnpm format:check
|
2022-11-12 16:05:08 -05:00
|
|
|
test:
|
2023-12-31 08:34:29 -05:00
|
|
|
needs: [prepare]
|
2019-10-01 15:08:40 -05:00
|
|
|
strategy:
|
2021-04-24 16:28:52 -05:00
|
|
|
fail-fast: true
|
2019-10-01 15:08:40 -05:00
|
|
|
matrix:
|
2022-09-18 14:47:23 -05:00
|
|
|
os: [ubuntu-latest]
|
2024-10-20 12:26:36 -05:00
|
|
|
node_version: [18, 20, 21, 22, 23]
|
2020-09-01 14:22:36 -05:00
|
|
|
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
2020-08-31 15:21:38 -05:00
|
|
|
runs-on: ${{ matrix.os }}
|
2019-10-01 15:08:40 -05:00
|
|
|
steps:
|
2024-11-02 04:02:18 -05:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2020-08-27 14:23:56 -05:00
|
|
|
- name: Use Node ${{ matrix.node_version }}
|
2024-11-02 05:38:10 -05:00
|
|
|
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
2020-08-27 14:23:56 -05:00
|
|
|
with:
|
2021-03-30 07:05:58 -05:00
|
|
|
node-version: ${{ matrix.node_version }}
|
2020-08-27 14:23:56 -05:00
|
|
|
- name: Install pnpm
|
2022-11-12 16:05:08 -05:00
|
|
|
run: |
|
|
|
|
corepack enable
|
2023-12-31 08:34:29 -05:00
|
|
|
corepack prepare
|
2024-11-02 06:01:14 -05:00
|
|
|
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2
|
2021-04-24 16:28:52 -05:00
|
|
|
with:
|
|
|
|
path: ~/.pnpm-store
|
2021-12-29 13:23:20 -05:00
|
|
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
2023-04-12 01:23:01 -05:00
|
|
|
- name: set store
|
|
|
|
run: |
|
2023-10-23 14:49:18 -05:00
|
|
|
pnpm config set store-dir ~/.pnpm-store
|
2020-08-27 14:23:56 -05:00
|
|
|
- name: Install
|
2023-08-21 14:16:12 -05:00
|
|
|
run: pnpm install --ignore-scripts --registry http://localhost:4873
|
2021-12-29 13:23:20 -05:00
|
|
|
- name: build
|
|
|
|
run: pnpm build
|
2021-04-24 16:28:52 -05:00
|
|
|
- name: Test
|
|
|
|
run: pnpm test
|
2021-09-18 02:20:24 -05:00
|
|
|
sync-translations:
|
2022-11-12 16:05:08 -05:00
|
|
|
needs: [test]
|
2021-09-18 02:20:24 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: synchronize translations
|
2024-04-28 04:52:38 -05:00
|
|
|
if: (github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'verdaccio/verdaccio') || github.event_name == 'workflow_dispatch'
|
2021-09-18 02:20:24 -05:00
|
|
|
steps:
|
2024-11-02 04:02:18 -05:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2024-11-02 05:38:10 -05:00
|
|
|
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
2021-09-18 02:20:24 -05:00
|
|
|
with:
|
2022-09-18 14:47:23 -05:00
|
|
|
node-version-file: '.nvmrc'
|
2021-09-18 02:20:24 -05:00
|
|
|
- name: Install pnpm
|
2022-11-12 16:05:08 -05:00
|
|
|
run: |
|
|
|
|
corepack enable
|
2023-10-23 14:49:18 -05:00
|
|
|
corepack install
|
2024-11-02 06:01:14 -05:00
|
|
|
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2
|
2021-09-18 02:20:24 -05:00
|
|
|
with:
|
|
|
|
path: ~/.pnpm-store
|
2021-12-29 13:23:20 -05:00
|
|
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
2023-04-12 01:23:01 -05:00
|
|
|
- name: set store
|
|
|
|
run: |
|
2023-10-23 14:49:18 -05:00
|
|
|
pnpm config set store-dir ~/.pnpm-store
|
2021-09-18 02:20:24 -05:00
|
|
|
- name: Install
|
|
|
|
## we need scripts, pupetter downloads aditional content
|
2023-08-21 14:16:12 -05:00
|
|
|
run: pnpm install --registry http://localhost:4873
|
2021-12-31 14:57:20 -05:00
|
|
|
- name: build
|
|
|
|
run: pnpm build
|
2021-09-18 02:43:14 -05:00
|
|
|
- name: generate website translations
|
2023-04-12 10:39:55 -05:00
|
|
|
run: pnpm --filter ...@verdaccio/website write-translations
|
2021-09-18 02:43:14 -05:00
|
|
|
- name: sync
|
2021-09-18 02:20:24 -05:00
|
|
|
env:
|
|
|
|
CROWDIN_VERDACCIO_API_KEY: ${{ secrets.CROWDIN_VERDACCIO_API_KEY }}
|
|
|
|
CONTEXT: production
|
2021-12-29 13:23:20 -05:00
|
|
|
run: pnpm crowdin:sync
|