diff options
author | Raphael Kabo <raphaelkabo@hey.com> | 2023-05-12 22:34:44 +0100 |
---|---|---|
committer | Raphael Kabo <raphaelkabo@hey.com> | 2023-05-12 22:53:47 +0100 |
commit | 4e88ef2bf383091ff5f0da69c5e2dfb5d52a0f40 (patch) | |
tree | f817a03f1bda35496c7720f0ce02891c48841b9e | |
parent | 67cf89fd0cfdf56c7e6d6d9bdf93d95d679ce2a1 (diff) |
Add CI workflow
-rw-r--r-- | .github/workflows/ci.yaml | 36 | ||||
-rw-r--r-- | package.json | 3 |
2 files changed, 38 insertions, 1 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..882c2c9 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,36 @@ +name: Build test +on: + pull_request: + workflow_dispatch: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 + with: + version: 8 + - uses: actions/setup-node@v3 + with: + node-version-file: ".nvmrc" + cache: "pnpm" + cache-dependency-path: "pnpm-lock.yaml" + - name: Install dependencies + run: pnpm install + - name: Set up config files + run: | + cp src/config/api-example.js src/config/api.js + cp src/config/database-example.js src/config/database.js + cp src/config/domain-example.js src/config/domain.js + - name: Build + run: pnpm build + continue-on-error: true + - name: Start and test + run: | + pnpm start & + sleep 5 + curl -sSf http://localhost:3000 diff --git a/package.json b/package.json index d765c0e..a00a53a 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "scripts": { "build": "tsc", "start": "node dist/start.js", - "dev": "nodemon -e ts,js --watch src --exec \"pnpm run build ; pnpm run start\"" + "dev": "nodemon -e ts,js --watch src --exec \"pnpm run build ; pnpm run start\"", + "test": "./test.sh" }, "engines": { "node": ">=16.16.0" |