forked from bcgov/platform-services-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (54 loc) · 2.14 KB
/
test.yml
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
name: 31.Test codebase
on: push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: hmarr/debug-action@f7318c783045ac39ed9bb497e22ce835fdafbfe6
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- name: Setup Tools
uses: ./.github/actions/setup-tools
- name: Setup NPM Packages
uses: ./.github/actions/setup-npm
- name: Run lint
run: npm run lint
- name: Run App build
run: npm run build
- name: Run Email build
run: npm run email-build
- name: Install Docker Compose v2
# See https://docs.docker.com/compose/install/linux/
run: |
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.23.0/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
docker compose version
- name: Run test
run: |
mkdir -p ./localdev/mnt/mongodb
mkdir -p ./localdev/mnt/postgres
export MACHINE_HOST_IP=$(hostname -I | awk '{print $1}')
~/.docker/cli-plugins/docker-compose -f localdev/docker-compose.yml -f localdev/docker-compose-ci.yml up -d
node_modules/.bin/wait-on http://localhost:8080/health/ready --timeout 120000
cp .env.example .env.test
npm run test
~/.docker/cli-plugins/docker-compose -f localdev/docker-compose.yml -f localdev/docker-compose-ci.yml down
sudo rm -rf ./localdev/mnt
pre-commit:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: hmarr/debug-action@f7318c783045ac39ed9bb497e22ce835fdafbfe6
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- name: Setup Tools
uses: ./.github/actions/setup-tools
- name: Setup NPM Packages
uses: ./.github/actions/setup-npm
- name: Rerun Pre-Commit Hooks on CI
run: |
pre-commit run --config=.pre-commit-config.yaml --color=always --show-diff-on-failure --all-files