-
Notifications
You must be signed in to change notification settings - Fork 14
/
action.yaml
77 lines (67 loc) · 2.08 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: 'Build, Lint, Diagnostics, and Tests'
description: 'Run CI on a Redwood Project'
inputs:
run-lint:
description: "run project lint ('yes' or 'no' as string)"
required: false
default: 'yes'
project-directory:
description: project directory path
required: true
default: './'
runs:
using: "composite"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js v16
uses: actions/setup-node@v3
with:
node-version: "16"
- name: Set up Postgres
uses: CasperWA/postgresql-action@v1
with:
postgresql version: '14'
postgresql db: 'test'
postgresql user: test
postgresql password: password
# Project is using Yarn 3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
shell: bash
- name: Cache yarn
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn-
- name: Set project directory
id: project-directory
run: echo "::set-output name=dir::${{ inputs.project-directory }}"
shell: bash
- name: Install dependencies
working-directory: ${{ steps.project-directory.outputs.dir }}
run: yarn install --immutable
shell: bash
- name: Run Build
working-directory: ${{ steps.project-directory.outputs.dir }}
run: yarn rw build
shell: bash
- name: Run Lint
if: ${{ inputs.run-lint == 'yes' }}
working-directory: ${{ steps.project-directory.outputs.dir }}
run: yarn rw lint
shell: bash
- name: Run Diagnostics
working-directory: ${{ steps.project-directory.outputs.dir }}
run: yarn rw check
shell: bash
- name: Run Tests
working-directory: ${{ steps.project-directory.outputs.dir }}
run: yarn rw test
env:
TEST_DATABASE_URL: postgresql://test:password@localhost:5432/test
shell: bash