Skip to content

Commit 370662d

Browse files
authored
Merge pull request #70 from formio/FIO-7336-formio-cli-run-tests-in-gh-actions
FIO-7336: formio-cli-run-tests-in-gh-actions
2 parents 0ed2407 + 08010ef commit 370662d

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

.github/workflows/test.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Repo
2+
3+
on:
4+
push:
5+
branches:
6+
- '*' # This will make sure all push events on any branch triggers this workflow.
7+
8+
env:
9+
NODE_VERSION: 20.x
10+
ADMIN_KEY: testAdminKey
11+
DOCKER_API_SRC_PORT: 4001
12+
DOCKER_API_DST_PORT: 4002
13+
DOCKER_MONGO_SRC: mongodb://mongo:27017/cli-test-src
14+
DOCKER_MONGO_DST: mongodb://mongo:27017/cli-test-dst
15+
LICENSE_REMOTE: false
16+
LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
17+
API_SRC: http://localhost:4001
18+
API_DST: http://localhost:4002
19+
MONGO_SRC: mongodb://localhost:27018/cli-test-src
20+
MONGO_DST: mongodb://localhost:27018/cli-test-dst
21+
22+
jobs:
23+
test:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- run: echo "Triggered by ${{ github.event_name }} event."
27+
- name: Check out repository code ${{ github.repository }} on ${{ github.ref }}
28+
uses: actions/checkout@v3
29+
30+
- name: Set up Node.js ${{ env.NODE_VERSION }}
31+
uses: actions/setup-node@v3
32+
with:
33+
node-version: ${{ env.NODE_VERSION }}
34+
cache: 'npm'
35+
36+
- name: Installing dependencies
37+
uses: borales/actions-yarn@v4
38+
with:
39+
cmd: install --frozen-lockfile
40+
41+
- name: Test
42+
if: true
43+
uses: borales/actions-yarn@v4
44+
with:
45+
cmd: test

test/createTemplate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ module.exports = (template) => {
6666
const result = await request(template.appSrc)
6767
.post('/project')
6868
.set('x-admin-key', process.env.ADMIN_KEY)
69-
.set('x-raw-data-access', createHmac('sha256', template.xToken).digest('hex'))
69+
// .set('x-raw-data-access', createHmac('sha256', template.xToken).digest('hex'))
7070
.send(formioApiSettings);
7171

7272
template.api.projectApi = result.body;

test/docker/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ DOCKER_API_DST_PORT=4002
44
DOCKER_MONGO_SRC=mongodb://mongo:27017/cli-test-src
55
DOCKER_MONGO_DST=mongodb://mongo:27017/cli-test-dst
66
LICENSE_REMOTE=false
7+
LICENSE_KEY=

0 commit comments

Comments
 (0)