Skip to content

Commit

Permalink
ci: INFRA-783 Build open-source condo on multiple OS runners 🏃 (#5689)
Browse files Browse the repository at this point in the history
* ci(global): test job added

* ci(global): initial trigger

* ci(global): initial trigger

* ci(global): initial trigger

* ci(global): initial trigger

* ci(global): initial trigger

* ci(global): initial trigger

* ci(global): deps check

* ci(global): deps check

* ci(global): deps check

* ci(global): deps check

* fix(ui): clean codegen via rimraf instead of find

* chore(ui): webpack alias

* chore(ui): debug

* chore(ui): change source path to glob

* chore(ui): remove alias

* ci(global): specify platform

* ci(global): specify platform

* ci(global): specify platform

* ci(global): specify shell

* ci(global): another option

* ci(global): env? pass

* ci(global): debug

* ci(global): tst

* ci(global): services CI

* ci(global): docker run?

* ci(global): docker run?

* ci(global): exp?

* ci(global): exp?

* ci: cross-platform DBs

* ci: add python venv

* ci: start step

* ci: INFRA-783 Build open-source condo on multiple OS runners 🏃

* ci: INFRA-783 adjust changes detection

* ci: INFRA-783 adjust changes detection

* ci: INFRA-783 switch trigger
  • Loading branch information
SavelevMatthew authored Jan 14, 2025
1 parent b0bb1d3 commit 0441121
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 7 deletions.
76 changes: 72 additions & 4 deletions .github/workflows/nodejs.condo.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ concurrency:
env:
DOCKER_IMAGE: condo/condo-image:${{ github.event.pull_request.head.sha || github.sha }}
DOCKER_IMAGE_FULL: ${{ secrets.DOCKER_REGISTRY }}/condo/condo-image:${{ github.event.pull_request.head.sha || github.sha }}
PG_IMAGE_FULL: ${{ secrets.DOCKER_REGISTRY }}/doma/utils/postgres:13.2
PG_IMAGE_FULL: ${{ secrets.DOCKER_REGISTRY }}/doma/utils/postgres:16.4
REDIS_IMAGE_FULL: ${{ secrets.DOCKER_REGISTRY }}/doma/utils/redis:6.2
REF: ${{ github.event.pull_request.head.sha || github.ref }}

Expand Down Expand Up @@ -119,8 +119,9 @@ jobs:
runs-on: ubuntu-22.04
outputs:
address-service: ${{ steps.detect-changes.outputs.address-service }}
dev-api: ${{ steps.detect-changes.outputs.dev-api }}
condorb: ${{ steps.detect-changes.outputs.condorb }}
dev-api: ${{ steps.detect-changes.outputs.dev-api }}
open-condo: ${{ steps.detect-changes.outputs.open-condo }}
registry: ${{ steps.detect-changes.outputs.registry }}
webhooks: ${{ steps.detect-changes.outputs.webhooks }}
steps:
Expand All @@ -147,11 +148,16 @@ jobs:
- 'apps/condo/domains/miniapp/**'
- 'apps/condo/domains/user/**'
- 'packages/**'
webhooks:
- 'packages/webhooks/**'
open-condo:
- 'packages/**'
- '**/*.md'
- '*'
- '!.helm/**'
registry:
- 'apps/registry/**'
- 'packages/**'
webhooks:
- 'packages/webhooks/**'
lint:
name: Lint source code
Expand Down Expand Up @@ -206,6 +212,68 @@ jobs:
ref: ${{ env.REF }}
- run: ./bin/run-semgrep.sh -a

open-condo-build:
name: Build open-source part
needs:
- authorize
- detect-changes
if: ${{ needs.detect-changes.outputs.open-condo == 'true' }}
strategy:
matrix:
os: [ ubuntu-22.04, windows-latest ]
node-version: [ 16.x ]
python-version: [ 3.13 ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code without submodules
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'false'
ssh-key: ${{ secrets.SSH_DOCK_SERVER_PRIVATE_KEY }}
ref: ${{ env.REF }}
- name: Setup native Postgres (Windows Runner only)
if: matrix.os == 'windows-latest'
uses: ikalnytskyi/action-setup-postgres@v7
with:
postgres-version: 16
- name: Setup native Redis (Windows Runner only)
if: matrix.os == 'windows-latest'
run: |
choco install redis --version 6.2.17 -y
redis-server --daemonize yes
- name: Setup databases (Linux Runners)
if: matrix.os != 'windows-latest'
run: |
docker compose up -d postgresdb redis
- name: Prepare Python environment
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Prepare Node environment
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install packages
run: |
pip install Django psycopg2-binary
npm i -g turbo
yarn --no-immutable
- name: Build condo dependencies
run: |
yarn workspace @app/condo build:deps
- name: Prepare local condo environment
run: |
node bin/prepare.js -f condo
- name: Build condo itself
run: |
yarn workspace @app/condo build
- name: Start condo app
run: |
yarn workspace @app/condo start & node bin/wait-apps-apis.js -f condo
run-address-service-tests:
name: Address-Service Tests
runs-on: ubuntu-22.04
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/bin/buildStyleVars/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const StyleDictionaryLib = require('style-dictionary')
const { allTransformers, webVarsTransformersChain } = require('./transformers')

const TOKENS_DIR = path.join(__dirname, '../..', 'src/tokens')
const SOURCE_PATH = path.join(TOKENS_DIR, 'sets/*.json')
const SOURCE_PATH = 'src/tokens/sets/*.json'
// Less is used for development, CSS is used for strict token values check
// Can be expanded with SCSS if someday we will decide to give tokens out
// It's also possible to generate mobile tokens for iOS and Android here
Expand Down
5 changes: 3 additions & 2 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
],
"scripts": {
"build:deps": "turbo build --filter=@open-condo/ui^...",
"build:styles": "find src/tokens -mindepth 1 -not -name 'tokens.json' -delete && node bin/prepare-tokens.js && node bin/buildStyleVars/runner.js --web less css",
"build:colors": "find src/colors -mindepth 1 -not -name 'index.ts' -delete && node bin/generate-colors.js",
"build:styles": "rimraf -g 'src/tokens/!(tokens.json)' && node bin/prepare-tokens.js && node bin/buildStyleVars/runner.js --web less css",
"build:colors": "rimraf -g 'src/colors/!(index.ts)' && node bin/generate-colors.js",
"build:tokens": "yarn build:styles && yarn build:colors",
"build:lib": "webpack --config webpack.prod.js && tsc --project tsconfig.prod.json",
"build": "yarn build:tokens && yarn build:lib",
Expand Down Expand Up @@ -107,6 +107,7 @@
"quicktype-core": "^6.0.71",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"rimraf": "^6.0.1",
"source-map-loader": "^4.0.1",
"storybook": "7.6.20",
"style-dictionary": "^3.9.2",
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14243,6 +14243,7 @@ __metadata:
react-markdown: ^6
react-phone-input-2: ^2.15.1
remark-gfm: ^1
rimraf: ^6.0.1
source-map-loader: ^4.0.1
storybook: 7.6.20
style-dictionary: ^3.9.2
Expand Down

0 comments on commit 0441121

Please sign in to comment.