-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (48 loc) · 1.58 KB
/
actions.yml
File metadata and controls
48 lines (48 loc) · 1.58 KB
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
name: GitHub actions workflows
on: [push]
jobs:
ci:
strategy:
matrix:
os: [ubuntu-latest]
nodejs-version: [12]
name: react-hooks-typescript-app with nodejs ${{ matrix.nodejs-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Git clone
uses: actions/checkout@v1
- name: Install curl
run: sudo apt-get install -y curl
- name: Setup NodeJS ${{ matrix.nodejs-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.nodejs-version }}
- name: Cache npm ${{ matrix.nodejs-version }} deps
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-${{ matrix.os }}-npm-
restore-keys: |
${{ runner.os }}-${{ matrix.os }}-npm-
- name: Install npm apps (wait-port)
run: npm install -g wait-port
- name: Cache react-hooks-typescript-app $GITHUB_WORKSPACE/node_modules
uses: actions/cache@v1
with:
path: $GITHUB_WORKSPACE/node_modules
key: ${{ runner.os }}-nodejs-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-nodejs-
${{ runner.os }}-
- name: Build app
run: |
cd $GITHUB_WORKSPACE && npm i -E
cd $GITHUB_WORKSPACE && npm build
cd $GITHUB_WORKSPACE && npm start
cd $GITHUB_WORKSPACE && npm run logs &
- name: Test app
run: |
wait-port 1234
curl 127.0.0.1:1234
- name: Stop app
run: cd $GITHUB_WORKSPACE && npm stop