@@ -17,54 +17,44 @@ jobs:
1717 strategy :
1818 fail-fast : false
1919 matrix :
20- create-app-command :
21- - " create-node-app -f --api rest --database postgres-knex --pipeline cloudrun-gitlab"
22- - " create-node-app -f --api graphql --database postgres-knex --pipeline cloudrun-gitlab"
23- - " create-node-app -f --api rest --database none --pipeline cloudrun-gitlab"
24- - " create-node-app -f --api graphql --database none --pipeline cloudrun-gitlab"
25- - " create-node-app -f --api rest --database none --pipeline none"
26- - " create-node-app -f --api none --database none --pipeline cloudrun-gitlab"
20+ create-app-options :
21+ - " --api rest --database none --pipeline cloudrun-gitlab"
22+ - " --api graphql --database none --pipeline cloudrun-gitlab"
23+ - " --api rest --database none --pipeline none"
24+ - " --api none --database none --pipeline cloudrun-gitlab"
2725 runs-on : ubuntu-latest
2826
2927 steps :
30- - name : Checkout
31- uses : actions/checkout@v3
32-
33- - name : Cache dependencies
34- uses : actions/cache@v3
28+ - id : create-node-app
29+ uses : AckeeCZ/create-node-app/.github/actions/test-create-project.yml
3530 with :
36- path : ~/.npm
37- key : npm-${{ hashFiles('package-lock.json') }}
38- restore-keys : npm-
39-
40- - name : Install dependencies
41- run : npm ci --ignore-scripts
42-
43- - name : Build the project
44- run : npm run build
45-
46- - name : Run npm link
47- run : npm link
48-
49- - name : Create project
50- run : ${{ matrix.create-app-command }}
51-
52- - name : Build created project
53- working-directory : ./node-app
54- run : npm run build
31+ options : ${{ matrix.create-app-options }}
5532
56- - name : Run lint
57- working-directory : ./node-app
58- run : npm run ci-lint
33+ create-projects-with-postgres :
34+ needs : " build"
35+ services :
36+ postgres :
37+ image : postgres
38+ env :
39+ POSTGRES_PASSWORD : node-app_docker
40+ POSTGRES_USER : node-app_docker
41+ POSTGRES_DB : node-app_docker
42+ options : >-
43+ --health-cmd pg_isready
44+ --health-interval 10s
45+ --health-timeout 5s
46+ --health-retries 5
47+ strategy :
48+ fail-fast : false
49+ matrix :
50+ create-app-options :
51+ - " --api none --database postgres-knex --pipeline none"
52+ - " --api rest --database postgres-knex --pipeline cloudrun-gitlab"
53+ - " --api graphql --database postgres-knex --pipeline cloudrun-gitlab"
54+ runs-on : ubuntu-latest
5955
60- - name : Run tests
61- working-directory : ./node-app
62- run : npm run ci-test
63-
64- - name : Run start
65- working-directory : ./node-app
66- run : |
67- npm run start &
68- start_pid=$!
69- sleep 10
70- kill $start_pid
56+ steps :
57+ - id : create-node-app
58+ uses : AckeeCZ/test-create-project
59+ with :
60+ options : ${{ matrix.create-app-options }}
0 commit comments