Skip to content

Commit

Permalink
Merge branch 'next' into pavel/merge/dev-to-next
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel910 authored Apr 5, 2024
2 parents 5607607 + 667479f commit 6e12605
Show file tree
Hide file tree
Showing 23 changed files with 1,599 additions and 1,570 deletions.
134 changes: 89 additions & 45 deletions .github/workflows/pullRequests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,6 @@
name: Pull Requests
'on': pull_request
jobs:
validateWorkflows:
name: Validate workflows
steps:
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: actions/checkout@v4
- name: Install dependencies
run: yarn --immutable
- name: Validate
run: npx github-actions-wac validate
runs-on: ubuntu-latest
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
validateCommits:
name: Validate commit messages
if: github.base_ref != 'dev'
Expand Down Expand Up @@ -50,12 +35,14 @@ jobs:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
constants:
name: Create constants
runs-on: ubuntu-latest
outputs:
global-cache-key: ${{ steps.global-cache-key.outputs.global-cache-key }}
run-cache-key: ${{ steps.run-cache-key.outputs.run-cache-key }}
is-fork-pr: ${{ steps.is-fork-pr.outputs.is-fork-pr }}
steps:
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Create global cache key
id: global-cache-key
run: >-
Expand All @@ -72,89 +59,111 @@ jobs:
run: >-
echo "is-fork-pr=${{ github.event.pull_request.head.repo.fork }}" >>
$GITHUB_OUTPUT
init:
name: Init
runs-on: ubuntu-latest
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
build:
name: Build
needs: constants
runs-on: webiny-build-packages
runs-on: blacksmith-8vcpu-ubuntu-2204
steps:
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: actions/checkout@v4
with:
path: ${{ github.base_ref }}
- uses: actions/cache@v4
with:
path: .yarn/cache
path: ${{ github.base_ref }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v4
with:
path: .webiny/cached-packages
path: ${{ github.base_ref }}/.webiny/cached-packages
key: ${{ needs.constants.outputs.global-cache-key }}
- name: Install dependencies
run: yarn --immutable
working-directory: ${{ github.base_ref }}
- name: Build packages
run: yarn build:quick
working-directory: ${{ github.base_ref }}
- uses: actions/cache@v4
with:
path: .webiny/cached-packages
path: ${{ github.base_ref }}/.webiny/cached-packages
key: ${{ needs.constants.outputs.run-cache-key }}
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
staticCodeAnalysis:
needs:
- constants
- init
- build
name: Static code analysis
steps:
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: actions/checkout@v4
with:
path: ${{ github.base_ref }}
- uses: actions/cache@v4
with:
path: .yarn/cache
path: ${{ github.base_ref }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v4
with:
path: .webiny/cached-packages
path: ${{ github.base_ref }}/.webiny/cached-packages
key: ${{ needs.constants.outputs.run-cache-key }}
- name: Install dependencies
run: yarn --immutable
working-directory: ${{ github.base_ref }}
- name: Check code formatting
run: yarn prettier:check
working-directory: ${{ github.base_ref }}
- name: Check dependencies
run: yarn adio
working-directory: ${{ github.base_ref }}
- name: Check TS configs
run: yarn check-ts-configs
working-directory: ${{ github.base_ref }}
- name: ESLint
run: yarn eslint
working-directory: ${{ github.base_ref }}
runs-on: ubuntu-latest
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
staticCodeAnalysisTs:
name: Static code analysis (TypeScript)
runs-on: webiny-build-packages
runs-on: blacksmith-8vcpu-ubuntu-2204
steps:
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: actions/checkout@v4
with:
path: ${{ github.base_ref }}
- uses: actions/cache@v4
with:
path: .yarn/cache
path: ${{ github.base_ref }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn --immutable
working-directory: ${{ github.base_ref }}
- name: Build packages (full)
run: yarn build
working-directory: ${{ github.base_ref }}
- name: Check types for Cypress tests
run: yarn cy:ts
working-directory: ${{ github.base_ref }}
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
jestTestsNoStorage:
needs: constants
needs:
- constants
- build
name: ${{ matrix.package.cmd }}
strategy:
fail-fast: false
Expand All @@ -176,22 +185,29 @@ jobs:
with:
node-version: 18
- uses: actions/checkout@v4
with:
path: ${{ github.base_ref }}
- uses: actions/cache@v4
with:
path: .yarn/cache
path: ${{ github.base_ref }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v4
with:
path: .webiny/cached-packages
path: ${{ github.base_ref }}/.webiny/cached-packages
key: ${{ needs.constants.outputs.run-cache-key }}
- name: Install dependencies
run: yarn --immutable
working-directory: ${{ github.base_ref }}
- name: Build packages
run: yarn build:quick
working-directory: ${{ github.base_ref }}
- name: Run tests
run: yarn test ${{ matrix.package.cmd }}
working-directory: ${{ github.base_ref }}
jestTestsDdb:
needs: constants
needs:
- constants
- build
name: ${{ matrix.package.cmd }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -228,22 +244,29 @@ jobs:
with:
node-version: 18
- uses: actions/checkout@v4
with:
path: ${{ github.base_ref }}
- uses: actions/cache@v4
with:
path: .yarn/cache
path: ${{ github.base_ref }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v4
with:
path: .webiny/cached-packages
path: ${{ github.base_ref }}/.webiny/cached-packages
key: ${{ needs.constants.outputs.run-cache-key }}
- name: Install dependencies
run: yarn --immutable
working-directory: ${{ github.base_ref }}
- name: Build packages
run: yarn build:quick
working-directory: ${{ github.base_ref }}
- name: Run tests
run: yarn test ${{ matrix.package.cmd }}
working-directory: ${{ github.base_ref }}
jestTestsDdbEs:
needs: constants
needs:
- constants
- build
name: ${{ matrix.package.cmd }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -285,25 +308,32 @@ jobs:
role-to-assume: arn:aws:iam::726952677045:role/GitHubActionsWebinyJs
aws-region: eu-central-1
- uses: actions/checkout@v4
with:
path: ${{ github.base_ref }}
- uses: actions/cache@v4
with:
path: .yarn/cache
path: ${{ github.base_ref }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v4
with:
path: .webiny/cached-packages
path: ${{ github.base_ref }}/.webiny/cached-packages
key: ${{ needs.constants.outputs.run-cache-key }}
- name: Install dependencies
run: yarn --immutable
working-directory: ${{ github.base_ref }}
- name: Build packages
run: yarn build:quick
working-directory: ${{ github.base_ref }}
- name: Run tests
run: yarn test ${{ matrix.package.cmd }}
working-directory: ${{ github.base_ref }}
permissions:
id-token: write
if: needs.constants.outputs.is-fork-pr != 'true'
jestTestsDdbOs:
needs: constants
needs:
- constants
- build
name: ${{ matrix.package.cmd }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -345,28 +375,33 @@ jobs:
role-to-assume: arn:aws:iam::726952677045:role/GitHubActionsWebinyJs
aws-region: eu-central-1
- uses: actions/checkout@v4
with:
path: ${{ github.base_ref }}
- uses: actions/cache@v4
with:
path: .yarn/cache
path: ${{ github.base_ref }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v4
with:
path: .webiny/cached-packages
path: ${{ github.base_ref }}/.webiny/cached-packages
key: ${{ needs.constants.outputs.run-cache-key }}
- name: Install dependencies
run: yarn --immutable
working-directory: ${{ github.base_ref }}
- name: Build packages
run: yarn build:quick
working-directory: ${{ github.base_ref }}
- name: Run tests
run: yarn test ${{ matrix.package.cmd }}
working-directory: ${{ github.base_ref }}
permissions:
id-token: write
if: needs.constants.outputs.is-fork-pr != 'true'
verdaccioPublish:
name: Publish to Verdaccio
needs:
- constants
- init
- build
if: needs.constants.outputs.is-fork-pr != 'true'
steps:
- uses: actions/setup-node@v4
Expand All @@ -376,38 +411,47 @@ jobs:
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
path: ${{ github.base_ref }}
- uses: actions/cache@v4
with:
path: .yarn/cache
path: ${{ github.base_ref }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v4
with:
path: .webiny/cached-packages
path: ${{ github.base_ref }}/.webiny/cached-packages
key: ${{ needs.constants.outputs.run-cache-key }}
- name: Install dependencies
run: yarn --immutable
working-directory: ${{ github.base_ref }}
- name: Build packages
run: yarn build:quick
working-directory: ${{ github.base_ref }}
- name: Start Verdaccio local server
run: npx pm2 start verdaccio -- -c .verdaccio.yaml
working-directory: ${{ github.base_ref }}
- name: Configure NPM to use local registry
run: npm config set registry http://localhost:4873
working-directory: ${{ github.base_ref }}
- name: Set git email
run: git config --global user.email "webiny-bot@webiny.com"
working-directory: ${{ github.base_ref }}
- name: Set git username
run: git config --global user.name "webiny-bot"
working-directory: ${{ github.base_ref }}
- name: Create ".npmrc" file in the project root, with a dummy auth token
run: echo '//localhost:4873/:_authToken="dummy-auth-token"' > .npmrc
working-directory: ${{ github.base_ref }}
- name: Version and publish to Verdaccio
run: yarn release --type=verdaccio
working-directory: ${{ github.base_ref }}
- name: Upload verdaccio files
uses: actions/upload-artifact@v4
with:
name: verdaccio-files
retention-days: 1
path: |
.verdaccio/
.verdaccio.yaml
path: |-
${{ github.base_ref }}/.verdaccio/
${{ github.base_ref }}/.verdaccio.yaml
runs-on: ubuntu-latest
env:
NODE_OPTIONS: '--max_old_space_size=4096'
Expand Down
Loading

0 comments on commit 6e12605

Please sign in to comment.