fix: logs and gendocs #400
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI-CD | |
on: | |
push: | |
branches: [master] | |
workflow_dispatch: | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:12.3-alpine | |
env: | |
POSTGRES_PASSWORD: postgres | |
# health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
dynamodb: | |
image: amazon/dynamodb-local:latest | |
ports: | |
- 8000:8000 | |
steps: | |
# - name: setup gcloud sdk | |
# uses: google-github-actions/setup-gcloud@v1 | |
# with: | |
# version: ">=363.0.0" | |
# - name: run firestore emulator | |
# run: gcloud emulators firestore start --host-port=localhost:8080 | |
# env: | |
# FIRESTORE_EMULATOR_HOST: localhost:8080 | |
# FIRESTORE_PROJECT_ID: test-project-id | |
# GCLOUD_PROJECT: test-project-id | |
- uses: actions/checkout@v4 | |
- name: install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
run_install: false | |
- name: install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: "pnpm" | |
- name: install and build | |
run: pnpm install && pnpm build | |
- name: unit test | |
run: pnpm jest --coverage | |
env: | |
PG_HOST: localhost | |
PG_USER: postgres | |
PG_PASSWORD: postgres | |
PG_DATABASE: postgres | |
AWS_REGION: us-east-1 | |
AWS_DYNAMO_ENDPOINT: http://localhost:8000 | |
AWS_CREDENTIALS_ACCESS_KEY_ID: accesskeyid | |
AWS_CREDENTIALS_SECRET_ACCESS_KEY: secretaccesskey | |
- name: coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
cd: | |
runs-on: ubuntu-latest | |
needs: ci | |
strategy: | |
max-parallel: 1 # to avoid git conflicts | |
matrix: | |
lib: | |
- eventually | |
- eventually-openapi | |
- eventually-pg | |
- eventually-express | |
- eventually-service-expg | |
- eventually-trpc | |
- eventually-broker | |
#- eventually-aws | |
#- eventually-azure | |
#- eventually-gcp | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
run_install: false | |
- name: install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: "pnpm" | |
- name: analyze ${{ matrix.lib }} | |
id: analyze | |
uses: rotorsoft/[email protected] | |
with: | |
package: "@rotorsoft/${{ matrix.lib }}" | |
directory: "libs/${{ matrix.lib }}" | |
- name: analysis | |
run: | | |
echo "last-tag: ${{ steps.analyze.outputs.last-tag }}" | |
echo "next-tag: ${{ steps.analyze.outputs.next-tag }}" | |
echo "next-version: ${{ steps.analyze.outputs.next-version }}" | |
echo "${{ steps.analyze.outputs.change-log }}" | |
- name: release ${{ matrix.lib }} | |
uses: rotorsoft/[email protected] | |
with: | |
github-token: "${{ secrets.GITHUB_TOKEN }}" | |
npm-registry: "registry.npmjs.org" | |
npm-token: "${{ secrets.NPM_TOKEN }}" | |
npm-access: "public" | |
user: "rotorsoft" | |
email: "[email protected]" | |
package: "@rotorsoft/${{ matrix.lib }}" | |
directory: "libs/${{ matrix.lib }}" | |
tag: "${{ steps.analyze.outputs.next-tag }}" | |
version: "${{ steps.analyze.outputs.next-version }}" | |
change-log: "${{ steps.analyze.outputs.change-log }}" |