Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .actrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-P ubuntu-latest=catthehacker/ubuntu:act-latest
-P ubuntu-24.04=catthehacker/ubuntu:act-latest
-P ubuntu-22.04=catthehacker/ubuntu:act-latest
20 changes: 20 additions & 0 deletions .docker/act/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM ubuntu:24.04

ARG DEBIAN_FRONTEND=noninteractive
ARG TARGETARCH

RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl tar git \
&& rm -rf /var/lib/apt/lists/*

RUN set -eu; \
case "${TARGETARCH}" in \
amd64) ACT_ARCH="x86_64" ;; \
arm64) ACT_ARCH="arm64" ;; \
*) echo "Unsupported TARGETARCH: ${TARGETARCH}" >&2; exit 1 ;; \
esac; \
curl -fsSL "https://github.com/nektos/act/releases/latest/download/act_Linux_${ACT_ARCH}.tar.gz" \
| tar -xz -C /usr/local/bin act; \
chmod +x /usr/local/bin/act

ENTRYPOINT ["act"]
35 changes: 35 additions & 0 deletions .github/actions/setup-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Setup dependencies
description: Setup Node, configure Yarn, restore Yarn cache, install dependencies, and expose node_modules/.bin

inputs:
node-version:
description: Node.js version passed to actions/setup-node
required: true

runs:
using: composite
steps:
- name: Use Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}

- name: Yarn configuration
shell: bash
run: make .yarnrc.yml

- name: Cache dependencies
uses: actions/cache@v4
with:
path: .yarn
key: ${{ runner.OS }}-node-${{ inputs.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-${{ inputs.node-version }}-yarn-

- name: Install dependencies
shell: bash
run: yarn install

- name: Fix PATH for hoisting
shell: bash
run: echo "${{ github.workspace }}/node_modules/.bin" >> "$GITHUB_PATH"
34 changes: 8 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,16 @@ jobs:
with:
fetch-depth: 0

- name: Use Node.js
uses: actions/setup-node@v4
- name: Setup dependencies
uses: ./.github/actions/setup-dependencies
with:
node-version: '24.x'

- name: Yarn configuration
run: make .yarnrc.yml

- name: Configure Git
run: |
git config --global user.email "integration@retailcrm.ru"
git config --global user.name "RetailCRM.CI"

- name: Install dependencies
run: yarn install

- name: Fix PATH for hoisting
run: echo "${{ github.workspace }}/node_modules/.bin" >> $GITHUB_PATH

- name: Build worktree
run: yarn workspaces foreach -A --topological-dev run build

Expand All @@ -64,7 +55,7 @@ jobs:
- name: Run release
if: ${{ inputs.prerelease == 'none' }}
run: |
echo "YARN_ENABLE_IMMUTABLE_INSTALLS=false" >> $GITHUB_ENV
echo "YARN_ENABLE_IMMUTABLE_INSTALLS=false" >> "$GITHUB_ENV"
yes | npx tsx scripts/release.ts

- name: Push tags to repository
Expand All @@ -83,7 +74,7 @@ jobs:
id: version
run: |
VERSION=$(grep -oP '"version":\s*"\K[^"]+' package.json)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "${VERSION}"

outputs:
Expand All @@ -97,20 +88,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
- name: Setup dependencies
uses: ./.github/actions/setup-dependencies
with:
node-version: '24.x'

- name: Yarn configuration
run: make .yarnrc.yml

- name: Install dependencies
run: yarn install

- name: Fix PATH for hoisting
run: echo "${{ github.workspace }}/node_modules/.bin" >> $GITHUB_PATH

- name: Build Storybook
run: yarn workspace @retailcrm/embed-ui-v1-components run storybook:build

Expand All @@ -122,7 +104,7 @@ jobs:

- name: Push version forward
id: version
run: echo "version=${{ needs.release.outputs.version }}" >> $GITHUB_OUTPUT
run: echo "version=${{ needs.release.outputs.version }}" >> "$GITHUB_OUTPUT"

outputs:
version: ${{ steps.version.outputs.version }}
Expand All @@ -142,7 +124,7 @@ jobs:
path: packages/v1-components/storybook/dist

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: packages/v1-components/storybook/dist
Expand Down
61 changes: 20 additions & 41 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
name: Tests

on: [ push, pull_request ]
on:
pull_request:
push:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
workflow-lint:
runs-on: ubuntu-latest

steps:
- name: Using branch ${{ github.ref }} for repository ${{ github.repository }}.
uses: actions/checkout@v4

- name: Run actionlint
uses: devops-actions/actionlint@v0.1.10

eslint:
needs: workflow-lint
runs-on: ubuntu-latest

strategy:
Expand All @@ -18,29 +33,11 @@ jobs:
- name: Using branch ${{ github.ref }} for repository ${{ github.repository }}.
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- name: Setup dependencies
uses: ./.github/actions/setup-dependencies
with:
node-version: ${{ matrix.node-version }}

- name: Yarn configuration
run: make .yarnrc.yml

- name: Cache dependencies
id: cache-deps
uses: actions/cache@v4
with:
path: .yarn
key: ${{ runner.OS }}-node-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-${{ matrix.node-version }}-yarn-

- name: Install dependencies
run: yarn install

- name: Fix PATH for hoisting
run: echo "${{ github.workspace }}/node_modules/.bin" >> $GITHUB_PATH

- name: Build worktree
run: yarn workspaces foreach -A --topological-dev run build

Expand All @@ -62,29 +59,11 @@ jobs:
- name: Using branch ${{ github.ref }} for repository ${{ github.repository }}.
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- name: Setup dependencies
uses: ./.github/actions/setup-dependencies
with:
node-version: ${{ matrix.node-version }}

- name: Yarn configuration
run: make .yarnrc.yml

- name: Cache dependencies
id: cache-deps
uses: actions/cache@v4
with:
path: .yarn
key: ${{ runner.OS }}-node-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-${{ matrix.node-version }}-yarn-

- name: Install dependencies
run: yarn install

- name: Fix PATH for hoisting
run: echo "${{ github.workspace }}/node_modules/.bin" >> $GITHUB_PATH

- name: Build worktree
run: yarn workspaces foreach -A --topological-dev run build

Expand Down
Loading