-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (89 loc) · 2.91 KB
/
Copy pathnode.js.yml
File metadata and controls
107 lines (89 loc) · 2.91 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
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: NodeJS CI
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
release:
types:
- created
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 30 # Just in case something goes realy real realy BAD.....
strategy:
fail-fast: false
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
#
# OS note: "windows-2019" os only support windows containers at the moment. No workarround found!!!
#
# save github action minutes - os: [ubuntu-20.04, macos-10.15]
# Save github action minutes - node-version: [12.x, 14.x, 16.x]
#
node-version: [16.x]
os: [ubuntu-20.04]
steps:
# - name: Display docker info
# run: |
# docker version
# docker-compose version
# dir "c:\Program Files\Docker\*"
# dir "c:\Program Files\Docker\Docker\*"
# dir "c:\Program Files\Docker\Docker\DockerCli.exe"
# '/C/Program Files/Docker/Docker/DockerCli.exe' -SwitchLinuxEngine
# docker version
# docker-compose version
# dir DockerCli.exe /s
- name: Checkout GIThub code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile # will run `yarn install --frozen-lockfile` command
- name: Lint code
run: yarn lint
- name: Display OS
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
echo Linux OS found
elif [ "$RUNNER_OS" == "Windows" ]; then
echo Windows OS found
elif [ "$RUNNER_OS" == "macOS" ]; then
echo macOS found
else
echo "$RUNNER_OS not supported"
fi
- name: Setup Docker on macOS
uses: docker-practice/actions-setup-docker@master
with:
docker_channel: test
docker_version: "20.10"
docker_buildx: false
- name: Start MYSQL docker container
run: docker-compose up -d mysql
- name: Sleep for 10s
uses: juliangruber/sleep-action@v1
with:
time: 10s
- name: Start keycloak docker container
run: docker-compose up -d keycloak
- name: Wait for docker container apps to finish starting
shell: bash
run: |
chmod +x ./WaitKeycloakAppRunning.sh
./WaitKeycloakAppRunning.sh
- name: Run tests against code
run: yarn test
- name: Package code
if: github.event_name == 'release' && github.event.action == 'created'
run: yarn pack