Skip to content
Draft
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
88 changes: 88 additions & 0 deletions .github/workflows/buildAndTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Build and Test

on:
push:
branches: ['main', 'develop']
pull_request:
branches: ['develop']

jobs:
buildAndTest:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

env:
# Persistent Rita
MYSQL_DATABASE: prita
MYSQL_HOST: localhost
MYSQL_USER: root
MYSQL_PASSWORD: root
PSQL_DATABASE: postgres
PSQL_HOST: localhost
PSQL_USER: postgres
PSQL_PASSWORD: postgres
# Rita Http
PORT: 3000
LOGLEVEL: info
DB_TYPE: POSTGRES
DB_HOST: localhost
DB_PORT: 5432
DB_USERNAME: postgres
DB_PASSWORD: postgres
DB_DATABASE: postgres
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres

# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
mysql:
image: mysql:5.7
env:
MYSQL_DATABASE: prita
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- name: Cache Turbo
uses: actions/cache@v3
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn build
- name: Test
run: yarn test


187 changes: 0 additions & 187 deletions .github/workflows/build_test_release.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/changeFiles.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
script: |
cd ~/rita
git pull
node common/scripts/install-run-rush.js install
node common/scripts/install-run-rush.js build -t rita-http
yarn install --immutable
yarn turbo build --filter=rita-http
pm2 restart rita-http
35 changes: 17 additions & 18 deletions .github/workflows/github_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,27 @@ jobs:
node-version: '22.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@educorvi'
cache: yarn
- name: Setup git
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Cache Rush
uses: actions/cache@v3
with:
path: |
common/temp/install-run
~/.rush
key: ${{ runner.os }}-${{ hashFiles('rush.json') }}
- name: Cache pnpm
uses: actions/cache@v3
with:
path: |
common/temp/pnpm-store
key: ${{ runner.os }}-${{ hashFiles('common/config/rush/pnpm-lock.yaml') }}
- name: Install
run: node common/scripts/install-run-rush.js install
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: node common/scripts/install-run-rush.js build
- name: Publish to NPM
run: node common/scripts/install-run-rush.js publish -p --include-all --version-policy "rita-publish" --set-access-level=public
run: yarn build
- name: Publish to GitHub Packages
run: |
for package_dir in rita-core persistent-rita rita-smt/node-smtlib rita-smt/main plugins/http; do
if [ -f "$package_dir/package.json" ]; then
cd "$package_dir"
if grep -q '"private".*:.*true' package.json; then
echo "Skipping $package_dir (private package)"
else
npm publish || echo "Failed to publish $package_dir or already published"
fi
cd -
fi
done
env:
NODE_AUTH_TOKEN: ${{ secrets.PUBLISH_GITHUB_PACKAGE_TOKEN }}
Loading