2019-10-01 22:08:40 +02:00
|
|
|
|
name: CI
|
|
|
|
|
|
2020-06-30 21:55:14 +02:00
|
|
|
|
on:
|
|
|
|
|
push:
|
|
|
|
|
pull_request:
|
|
|
|
|
paths:
|
2020-09-07 07:36:08 +02:00
|
|
|
|
- .changeset/**
|
2020-06-30 21:55:14 +02:00
|
|
|
|
- .github/workflows/ci.yml
|
2020-09-01 21:22:36 +02:00
|
|
|
|
- 'packages/**'
|
2022-08-03 08:01:27 +02:00
|
|
|
|
- 'test/**'
|
2021-12-29 19:23:20 +01:00
|
|
|
|
- 'docker-examples/**'
|
2020-09-01 21:22:36 +02:00
|
|
|
|
- 'jest/**'
|
|
|
|
|
- 'package.json'
|
|
|
|
|
- 'pnpm-workspace.yaml'
|
2022-04-28 11:06:00 -05:00
|
|
|
|
permissions:
|
|
|
|
|
contents: read
|
|
|
|
|
|
2019-10-01 22:08:40 +02:00
|
|
|
|
jobs:
|
2021-04-24 23:28:52 +02:00
|
|
|
|
prepare:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
name: setup verdaccio
|
|
|
|
|
services:
|
|
|
|
|
verdaccio:
|
2022-08-19 20:25:20 +02:00
|
|
|
|
image: verdaccio/verdaccio:nightly-master
|
2021-04-24 23:28:52 +02:00
|
|
|
|
ports:
|
|
|
|
|
- 4873:4873
|
2022-09-18 21:47:23 +02:00
|
|
|
|
env:
|
|
|
|
|
NODE_ENV: production
|
2021-04-24 23:28:52 +02:00
|
|
|
|
steps:
|
2022-10-10 17:59:20 +02:00
|
|
|
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
2022-09-18 21:47:23 +02:00
|
|
|
|
- name: Node
|
2022-10-18 21:36:22 +02:00
|
|
|
|
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3
|
2021-04-24 23:28:52 +02:00
|
|
|
|
with:
|
2022-09-18 21:47:23 +02:00
|
|
|
|
node-version-file: '.nvmrc'
|
2021-04-24 23:28:52 +02:00
|
|
|
|
- name: Install pnpm
|
2022-11-12 22:05:08 +01:00
|
|
|
|
run: |
|
|
|
|
|
corepack enable
|
|
|
|
|
corepack prepare --activate pnpm@6.32.15
|
2021-04-24 23:28:52 +02:00
|
|
|
|
- name: set store
|
2021-12-29 19:23:20 +01:00
|
|
|
|
run: |
|
2021-04-24 23:28:52 +02:00
|
|
|
|
mkdir ~/.pnpm-store
|
|
|
|
|
pnpm config set store-dir ~/.pnpm-store
|
|
|
|
|
- name: Install
|
|
|
|
|
run: pnpm recursive install --frozen-lockfile --registry http://localhost:4873
|
|
|
|
|
- name: Cache .pnpm-store
|
2022-10-18 22:28:46 +02:00
|
|
|
|
uses: actions/cache@1c73980b09e7aea7201f325a7aa3ad00beddcdda # tag=v3
|
2021-04-24 23:28:52 +02:00
|
|
|
|
with:
|
|
|
|
|
path: ~/.pnpm-store
|
|
|
|
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
|
|
|
|
restore-keys: |
|
|
|
|
|
pnpm-
|
|
|
|
|
lint:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
name: Lint
|
|
|
|
|
needs: prepare
|
|
|
|
|
steps:
|
2022-10-10 17:59:20 +02:00
|
|
|
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
2022-09-18 21:47:23 +02:00
|
|
|
|
- name: Node
|
2022-10-18 21:36:22 +02:00
|
|
|
|
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3
|
2021-04-24 23:28:52 +02:00
|
|
|
|
with:
|
2022-09-18 21:47:23 +02:00
|
|
|
|
node-version-file: '.nvmrc'
|
2021-04-24 23:28:52 +02:00
|
|
|
|
- name: Install pnpm
|
2022-11-12 22:05:08 +01:00
|
|
|
|
run: |
|
|
|
|
|
corepack enable
|
|
|
|
|
corepack prepare --activate pnpm@6.32.15
|
2022-10-18 22:28:46 +02:00
|
|
|
|
- uses: actions/cache@1c73980b09e7aea7201f325a7aa3ad00beddcdda # tag=v3
|
2021-04-24 23:28:52 +02:00
|
|
|
|
with:
|
|
|
|
|
path: ~/.pnpm-store
|
2021-12-29 19:23:20 +01:00
|
|
|
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
2021-04-24 23:28:52 +02:00
|
|
|
|
- name: Install
|
2022-09-18 21:47:23 +02:00
|
|
|
|
run: pnpm recursive install --offline --frozen-lockfile --reporter=silence --ignore-scripts
|
2021-04-24 23:28:52 +02:00
|
|
|
|
- name: Lint
|
|
|
|
|
run: pnpm lint
|
|
|
|
|
format:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
name: Format
|
|
|
|
|
needs: prepare
|
|
|
|
|
steps:
|
2022-10-10 17:59:20 +02:00
|
|
|
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
2022-09-18 21:47:23 +02:00
|
|
|
|
- name: Use Node
|
2022-10-18 21:36:22 +02:00
|
|
|
|
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3
|
2021-04-24 23:28:52 +02:00
|
|
|
|
with:
|
2022-09-18 21:47:23 +02:00
|
|
|
|
node-version-file: '.nvmrc'
|
2021-04-24 23:28:52 +02:00
|
|
|
|
- name: Install pnpm
|
2022-11-12 22:05:08 +01:00
|
|
|
|
run: |
|
|
|
|
|
corepack enable
|
|
|
|
|
corepack prepare --activate pnpm@6.32.15
|
2022-10-18 22:28:46 +02:00
|
|
|
|
- uses: actions/cache@1c73980b09e7aea7201f325a7aa3ad00beddcdda # tag=v3
|
2021-04-24 23:28:52 +02:00
|
|
|
|
with:
|
|
|
|
|
path: ~/.pnpm-store
|
2021-12-29 19:23:20 +01:00
|
|
|
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
2021-04-24 23:28:52 +02:00
|
|
|
|
- name: Install
|
2022-09-18 21:47:23 +02:00
|
|
|
|
run: pnpm recursive install --offline --frozen-lockfile --reporter=silence --ignore-scripts
|
2021-04-24 23:28:52 +02:00
|
|
|
|
- name: Lint
|
|
|
|
|
run: pnpm format:check
|
2022-11-12 22:05:08 +01:00
|
|
|
|
test:
|
2021-12-29 19:23:20 +01:00
|
|
|
|
needs: [format, lint]
|
2019-10-01 22:08:40 +02:00
|
|
|
|
strategy:
|
2021-04-24 23:28:52 +02:00
|
|
|
|
fail-fast: true
|
2019-10-01 22:08:40 +02:00
|
|
|
|
matrix:
|
2022-09-18 21:47:23 +02:00
|
|
|
|
os: [ubuntu-latest]
|
2022-07-29 20:51:45 +02:00
|
|
|
|
node_version: [16, 18]
|
2020-09-01 21:22:36 +02:00
|
|
|
|
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
2020-08-31 22:21:38 +02:00
|
|
|
|
runs-on: ${{ matrix.os }}
|
2019-10-01 22:08:40 +02:00
|
|
|
|
steps:
|
2022-10-10 17:59:20 +02:00
|
|
|
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
2020-08-27 21:23:56 +02:00
|
|
|
|
- name: Use Node ${{ matrix.node_version }}
|
2022-10-18 21:36:22 +02:00
|
|
|
|
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3
|
2020-08-27 21:23:56 +02:00
|
|
|
|
with:
|
2021-03-30 14:05:58 +02:00
|
|
|
|
node-version: ${{ matrix.node_version }}
|
2020-08-27 21:23:56 +02:00
|
|
|
|
- name: Install pnpm
|
2022-11-12 22:05:08 +01:00
|
|
|
|
run: |
|
|
|
|
|
corepack enable
|
|
|
|
|
corepack prepare --activate pnpm@6.32.15
|
2022-10-18 22:28:46 +02:00
|
|
|
|
- uses: actions/cache@1c73980b09e7aea7201f325a7aa3ad00beddcdda # tag=v3
|
2021-04-24 23:28:52 +02:00
|
|
|
|
with:
|
|
|
|
|
path: ~/.pnpm-store
|
2021-12-29 19:23:20 +01:00
|
|
|
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
2020-08-27 21:23:56 +02:00
|
|
|
|
- name: Install
|
2022-09-18 21:47:23 +02:00
|
|
|
|
run: pnpm recursive install --offline --frozen-lockfile --reporter=silence --ignore-scripts --registry http://localhost:4873
|
2021-12-29 19:23:20 +01:00
|
|
|
|
- name: build
|
|
|
|
|
run: pnpm build
|
2021-04-24 23:28:52 +02:00
|
|
|
|
- name: Test
|
|
|
|
|
run: pnpm test
|
2021-09-18 09:20:24 +02:00
|
|
|
|
sync-translations:
|
2022-11-12 22:05:08 +01:00
|
|
|
|
needs: [test]
|
2021-09-18 09:20:24 +02:00
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
name: synchronize translations
|
|
|
|
|
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
|
|
|
|
|
steps:
|
2022-10-10 17:59:20 +02:00
|
|
|
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
2022-10-18 21:36:22 +02:00
|
|
|
|
- uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3
|
2021-09-18 09:20:24 +02:00
|
|
|
|
with:
|
2022-09-18 21:47:23 +02:00
|
|
|
|
node-version-file: '.nvmrc'
|
2021-09-18 09:20:24 +02:00
|
|
|
|
- name: Install pnpm
|
2022-11-12 22:05:08 +01:00
|
|
|
|
run: |
|
|
|
|
|
corepack enable
|
|
|
|
|
corepack prepare --activate pnpm@6.32.15
|
2022-10-18 22:28:46 +02:00
|
|
|
|
- uses: actions/cache@1c73980b09e7aea7201f325a7aa3ad00beddcdda # tag=v3
|
2021-09-18 09:20:24 +02:00
|
|
|
|
with:
|
|
|
|
|
path: ~/.pnpm-store
|
2021-12-29 19:23:20 +01:00
|
|
|
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
2021-09-18 09:20:24 +02:00
|
|
|
|
- name: Install
|
|
|
|
|
## we need scripts, pupetter downloads aditional content
|
2022-09-18 21:47:23 +02:00
|
|
|
|
run: pnpm recursive install --frozen-lockfile --registry http://localhost:4873
|
2021-12-31 20:57:20 +01:00
|
|
|
|
- name: build
|
|
|
|
|
run: pnpm build
|
2021-09-18 09:43:14 +02:00
|
|
|
|
- name: generate website translations
|
2021-12-29 19:23:20 +01:00
|
|
|
|
run: pnpm write-translations --filter ...@verdaccio/website
|
2021-09-18 09:43:14 +02:00
|
|
|
|
- name: sync
|
2021-09-18 09:20:24 +02:00
|
|
|
|
env:
|
|
|
|
|
CROWDIN_VERDACCIO_API_KEY: ${{ secrets.CROWDIN_VERDACCIO_API_KEY }}
|
|
|
|
|
CONTEXT: production
|
2021-12-29 19:23:20 +01:00
|
|
|
|
run: pnpm crowdin:sync
|