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
|
|
|
|
|
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:
|
2023-04-17 00:14:00 -05:00
|
|
|
image: verdaccio/verdaccio:5
|
2021-04-24 16:28:52 -05:00
|
|
|
ports:
|
|
|
|
- 4873:4873
|
2022-09-18 14:47:23 -05:00
|
|
|
env:
|
|
|
|
NODE_ENV: production
|
2021-04-24 16:28:52 -05:00
|
|
|
steps:
|
2023-06-11 20:36:44 -05:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
|
2022-09-18 14:47:23 -05:00
|
|
|
- name: Node
|
2023-08-21 09:51:37 -05:00
|
|
|
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # tag=v3
|
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-04-12 01:23:01 -05:00
|
|
|
corepack prepare --activate pnpm@latest-8
|
2021-04-24 16:28:52 -05:00
|
|
|
- name: set store
|
2021-12-29 13:23:20 -05:00
|
|
|
run: |
|
2021-04-24 16:28:52 -05:00
|
|
|
mkdir ~/.pnpm-store
|
|
|
|
pnpm config set store-dir ~/.pnpm-store
|
|
|
|
- name: Install
|
2023-04-12 01:23:01 -05:00
|
|
|
run: pnpm install --registry http://localhost:4873
|
2021-04-24 16:28:52 -05:00
|
|
|
- name: Cache .pnpm-store
|
2023-03-16 01:31:06 -05:00
|
|
|
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
|
2021-04-24 16:28:52 -05:00
|
|
|
with:
|
|
|
|
path: ~/.pnpm-store
|
|
|
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
pnpm-
|
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Lint
|
|
|
|
needs: prepare
|
|
|
|
steps:
|
2023-06-11 20:36:44 -05:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
|
2022-09-18 14:47:23 -05:00
|
|
|
- name: Node
|
2023-08-21 09:51:37 -05:00
|
|
|
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # tag=v3
|
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-04-12 01:23:01 -05:00
|
|
|
corepack prepare --activate pnpm@latest-8
|
2023-03-16 01:31:06 -05:00
|
|
|
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
|
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: |
|
|
|
|
pnpm config set store-dir ~/.pnpm-store
|
2021-04-24 16:28:52 -05:00
|
|
|
- name: Install
|
2023-04-12 01:23:01 -05:00
|
|
|
run: pnpm install --offline --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:
|
2023-06-11 20:36:44 -05:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
|
2022-09-18 14:47:23 -05:00
|
|
|
- name: Use Node
|
2023-08-21 09:51:37 -05:00
|
|
|
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # tag=v3
|
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-04-12 01:23:01 -05:00
|
|
|
corepack prepare --activate pnpm@latest-8
|
2023-03-16 01:31:06 -05:00
|
|
|
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
|
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: |
|
|
|
|
pnpm config set store-dir ~/.pnpm-store
|
2021-04-24 16:28:52 -05:00
|
|
|
- name: Install
|
2023-04-12 01:23:01 -05:00
|
|
|
run: pnpm install --offline --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:
|
2021-12-29 13:23:20 -05:00
|
|
|
needs: [format, lint]
|
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]
|
2022-07-29 13:51:45 -05:00
|
|
|
node_version: [16, 18]
|
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:
|
2023-06-11 20:36:44 -05:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
|
2020-08-27 14:23:56 -05:00
|
|
|
- name: Use Node ${{ matrix.node_version }}
|
2023-08-21 09:51:37 -05:00
|
|
|
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # tag=v3
|
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-04-12 01:23:01 -05:00
|
|
|
corepack prepare --activate pnpm@latest-8
|
2023-03-16 01:31:06 -05:00
|
|
|
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
|
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: |
|
|
|
|
pnpm config set store-dir ~/.pnpm-store
|
2020-08-27 14:23:56 -05:00
|
|
|
- name: Install
|
2023-04-12 01:23:01 -05:00
|
|
|
run: pnpm install --offline --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
|
2023-04-12 01:23:01 -05:00
|
|
|
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
|
2021-09-18 02:20:24 -05:00
|
|
|
steps:
|
2023-06-11 20:36:44 -05:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
|
2023-08-21 09:51:37 -05:00
|
|
|
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # tag=v3
|
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-04-12 01:23:01 -05:00
|
|
|
corepack prepare --activate pnpm@latest-8
|
2023-03-16 01:31:06 -05:00
|
|
|
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
|
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: |
|
|
|
|
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-04-12 01:23:01 -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
|