|
1 | | -# This is a basic workflow to help you get started with Actions |
2 | | - |
3 | 1 | name: CI |
4 | 2 |
|
5 | | -on: |
6 | | - push: |
7 | | - branches: [master] |
8 | | - pull_request: |
9 | | - branches: [master] |
| 3 | +on: [push] |
10 | 4 |
|
11 | 5 | jobs: |
12 | 6 | build: |
| 7 | + # https://github.com/actions/runner-images#available-images |
13 | 8 | runs-on: ubuntu-20.04 |
14 | 9 |
|
15 | 10 | steps: |
16 | | - - uses: actions/checkout@v2 |
| 11 | + - uses: actions/checkout@v3 |
17 | 12 |
|
18 | 13 | - name: Setup Node.js environment |
19 | | - uses: actions/setup-node@v1.4.4 |
| 14 | + uses: actions/setup-node@v3 |
20 | 15 | with: |
21 | 16 | node-version: '14.16.1' |
22 | 17 |
|
23 | 18 | - name: Install npm dependencies |
24 | 19 | run: npm ci |
25 | 20 |
|
| 21 | + - name: Prisma generate |
| 22 | + run: npm run prisma:generate |
| 23 | + |
26 | 24 | - name: Unit tests |
27 | 25 | run: npm run test:cov |
28 | 26 |
|
29 | | - - name: Codacy Coverage Reporter |
30 | | - |
31 | | - with: |
32 | | - project-token: ${{ secrets.CODACY_TOKEN }} |
33 | | - |
34 | | - - name: Setup PostgreSQL |
35 | | - |
36 | | - with: |
37 | | - postgresql db: vrt_db_dev |
38 | | - postgresql user: postgres |
39 | | - postgresql password: postgres |
| 27 | + - name: Build and run containers |
| 28 | + run: docker-compose up --build -d |
40 | 29 |
|
41 | | - - name: Wait untill DB started (workaround of https://github.com/Harmon758/postgresql-action/issues/7) |
42 | | - uses: jakejarvis/[email protected] |
| 30 | + # FIXME: This action is unmaintained. |
| 31 | + - name: Wait untill service started (replace with health status check) |
| 32 | + uses: jakejarvis/[email protected] |
43 | 33 | with: |
44 | | - time: '5s' |
| 34 | + time: '10s' |
45 | 35 |
|
46 | | - - name: Apply Manual DB migrations |
47 | | - run: npx ts-node ./prisma/manual_migrations.ts |
48 | | - |
49 | | - - name: Apply DB migrations |
50 | | - run: npx prisma migrate up -c --experimental |
51 | | - |
52 | | - - name: Seed DB data |
53 | | - run: npx ts-node ./prisma/seed.ts |
| 36 | + - name: Run acceptance tests |
| 37 | + run: npm run test:acceptance |
54 | 38 |
|
55 | 39 | - name: Run e2e tests |
56 | 40 | run: npm run test:e2e |
| 41 | + |
| 42 | + - name: Stop containers |
| 43 | + if: always() |
| 44 | + run: docker-compose down |
| 45 | + |
| 46 | + - name: Codacy Coverage Reporter |
| 47 | + uses: codacy/codacy-coverage-reporter-action@v1 |
| 48 | + with: |
| 49 | + project-token: ${{ secrets.CODACY_TOKEN }} |
0 commit comments