generated from hackariens/github
-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (129 loc) · 3.94 KB
/
ci.yml
File metadata and controls
151 lines (129 loc) · 3.94 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: CI/CD Pipeline
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
env:
DOCKER_COMPOSE_VERSION: '2.29.7'
jobs:
lint:
runs-on: ubuntu-24.04
timeout-minutes: 60
env:
DOCKER_INTERACTIVE: false
steps:
# === SETUP PHASE ===
- name: Checkout
uses: actions/checkout@v5
with:
submodules: recursive
- name: Setup Docker Compose
uses: docker/setup-compose-action@v1
- name: Setup Task
uses: go-task/setup-task@v1
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: 'package-lock.json'
- name: Setup cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
run: |
if [ ! -d node_modules ]; then
npm install
fi
- name: Setup environment files
run: |
cp .env.example .env
- name: lint all
run: task lint:all
launch:
runs-on: ubuntu-24.04
timeout-minutes: 60
env:
DOCKER_INTERACTIVE: false
steps:
# === SETUP PHASE ===
- name: Checkout
uses: actions/checkout@v5
with:
submodules: recursive
- name: Setup Docker Compose
uses: docker/setup-compose-action@v1
- name: Setup Task
uses: go-task/setup-task@v1
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: 'package-lock.json'
- name: Repository lampy
uses: actions/checkout@v5
with:
submodules: recursive
repository: koromerzhin/lampy
ref: '4.4.0'
path: lampy
# === BUILD PHASE ===
- name: Install dependencies
run: npm install --prefer-offline --no-audit
- name: Setup environment files
run: |
cp .env.example .env
# === INFRASTRUCTURE PHASE ===
- name: Setup Docker cache
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Setup database and infrastructure
run: |
task prestashop:copysql
cd lampy && task lampy:exec
- name: Deploy containers
run: |
task prestashop:getpull-image
task create:apps
task prestashop:getapacheconf
task prestashop:deploy
task prestashop:waiting
- name: Run Cypress tests
uses: cypress-io/github-action@v6
continue-on-error: true
with:
wait-on-timeout: 120
browser: chrome
record: false
parallel: false
config: screenshotOnRunFailure=true,video=true,videoCompression=32,defaultCommandTimeout=10000,requestTimeout=10000,responseTimeout=10000,retries={"runMode":2,"openMode":0}
env:
CYPRESS_CACHE_FOLDER: ~/.cache/Cypress
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
- name: Docker stack stop
if: always()
run: |
docker stack rm prestashop
docker stack rm lampy
# === ARTIFACTS PHASE ===
- name: Archive test results
uses: actions/upload-artifact@v4
if: always()
with:
name: "test-results-${{ github.run_number }}-${{ github.sha }}"
path: |
cypress/screenshots
cypress/videos
cypress/reports
retention-days: 7
if-no-files-found: ignore
compression-level: 6