docs: update docs #378
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: | |
# .yarnrc.yml needs this | |
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@v3 | |
- name: install node 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: install and build | |
run: yarn install && yarn build | |
- name: unit test | |
run: yarn test --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-broker | |
- eventually-service-expg | |
- calculator-artifacts | |
- eventually-aws | |
- eventually-gcp | |
- eventually-azure | |
- eventually-trpc | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: install node 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: analyze ${{ matrix.lib }} | |
id: analyze | |
uses: rotorsoft/semrel-analyze@v2 | |
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/semrel-release@v1 | |
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 }}" |