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 18:06:00 +02: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-08-22 17:58:45 +02:00
|
|
|
|
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
2022-09-18 21:47:23 +02:00
|
|
|
|
- name: Node
|
2022-08-22 17:58:45 +02:00
|
|
|
|
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # 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-05-19 22:03:04 +02:00
|
|
|
|
run: npm i pnpm@6.32.15 -g
|
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-08-22 17:58:45 +02:00
|
|
|
|
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # 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-08-22 17:58:45 +02:00
|
|
|
|
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
2022-09-18 21:47:23 +02:00
|
|
|
|
- name: Node
|
2022-08-22 17:58:45 +02:00
|
|
|
|
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # 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-05-19 22:03:04 +02:00
|
|
|
|
run: npm i pnpm@6.32.15 -g
|
2022-08-22 17:58:45 +02:00
|
|
|
|
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # 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-08-22 17:58:45 +02:00
|
|
|
|
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
2022-09-18 21:47:23 +02:00
|
|
|
|
- name: Use Node
|
2022-08-22 17:58:45 +02:00
|
|
|
|
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # 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-05-19 22:03:04 +02:00
|
|
|
|
run: npm i pnpm@6.32.15 -g
|
2022-08-22 17:58:45 +02:00
|
|
|
|
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # 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
|
2021-12-29 19:23:20 +01:00
|
|
|
|
build:
|
|
|
|
|
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-08-22 17:58:45 +02:00
|
|
|
|
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
2020-08-27 21:23:56 +02:00
|
|
|
|
- name: Use Node ${{ matrix.node_version }}
|
2022-08-22 17:58:45 +02:00
|
|
|
|
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # 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-05-19 22:03:04 +02:00
|
|
|
|
run: npm i pnpm@6.32.15 -g
|
2022-08-22 17:58:45 +02:00
|
|
|
|
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # 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
|
|
|
|
|
ci-e2e-ui:
|
2021-12-31 18:32:20 +01:00
|
|
|
|
needs: [format, lint]
|
2021-04-24 23:28:52 +02:00
|
|
|
|
runs-on: ubuntu-latest
|
2022-09-18 21:47:23 +02:00
|
|
|
|
name: UI Test E2E
|
2021-04-24 23:28:52 +02:00
|
|
|
|
steps:
|
2022-08-22 17:58:45 +02:00
|
|
|
|
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
|
|
|
|
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # 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-05-19 22:03:04 +02:00
|
|
|
|
run: npm i pnpm@6.32.15 -g
|
2022-08-22 17:58:45 +02:00
|
|
|
|
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # 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 --registry http://localhost:4873
|
2021-12-31 18:32:20 +01:00
|
|
|
|
- name: build
|
|
|
|
|
run: pnpm build
|
2021-04-24 23:28:52 +02:00
|
|
|
|
- name: Test UI
|
|
|
|
|
run: pnpm test:e2e:ui
|
2021-09-12 16:21:19 +02:00
|
|
|
|
# env:
|
2021-12-29 19:23:20 +01:00
|
|
|
|
# DEBUG: verdaccio:e2e*
|
2021-09-18 09:20:24 +02:00
|
|
|
|
sync-translations:
|
2022-09-18 21:47:23 +02:00
|
|
|
|
needs: [ci-e2e-ui]
|
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-08-22 17:58:45 +02:00
|
|
|
|
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
|
|
|
|
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # 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-05-19 22:03:04 +02:00
|
|
|
|
run: npm i pnpm@6.32.15 -g
|
2022-08-22 17:58:45 +02:00
|
|
|
|
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # 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
|