1- name : ci
2- on : [push]
1+ name : CI Pipeline
2+ on :
3+ push :
4+ paths-ignore :
5+ - ' **.md'
6+ - ' docs/**'
7+ - ' .gitignore'
8+ pull_request :
9+ paths-ignore :
10+ - ' **.md'
11+ - ' docs/**'
12+ - ' .gitignore'
13+
14+ env :
15+ NODE_VERSION : ' 22'
16+ DOCKER_COMPOSE_VERSION : ' 2.29.7'
17+
318jobs :
4- tests :
19+ ci :
520 runs-on : ubuntu-24.04
21+ timeout-minutes : 60
22+ env :
23+ DOCKER_INTERACTIVE : false
624 steps :
25+ # === SETUP PHASE ===
726 - name : Checkout
827 uses : actions/checkout@v4
928 with :
1029 submodules : recursive
30+
31+ - name : Setup Docker Compose
32+ run : |
33+ if ! command -v docker-compose &> /dev/null; then
34+ sudo curl -L "https://github.com/docker/compose/releases/download/v${{ env.DOCKER_COMPOSE_VERSION }}/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose
35+ sudo chmod +x /usr/local/bin/docker-compose
36+ fi
37+ docker-compose --version
38+
39+ - name : Setup Task
40+ uses : go-task/setup-task@v1
41+
42+ - name : Setup Node.js
43+ uses : actions/setup-node@v4
44+ with :
45+ node-version : ${{ env.NODE_VERSION }}
46+ cache : ' npm'
47+ cache-dependency-path : ' package-lock.json'
48+
1149 - name : Repository lampy
1250 uses : actions/checkout@v4
1351 with :
1452 submodules : recursive
15- ref : ' v2.0'
1653 repository : koromerzhin/lampy
54+ ref : ' v4.0'
1755 path : lampy
18- - name : Install npm dependencies
19- run : npm install
20- - name : ' set .env'
21- run : ' cp .env.example .env'
22- - name : ' Launch Lampy'
23- run : cd lampy && npm run exec
24- - name : ' Image pull'
25- run : npm run docker:getpull-image
26- - name : ' Build containers'
27- run : npm run docker:deploy
28- - name : ' Waiting'
29- run : npm run docker:waiting
30- - name : linter readme.md
31- run : npm run lint:markdown
32- - name : Cypress run
56+
57+ # === BUILD PHASE ===
58+ - name : Install dependencies
59+ run : npm ci --prefer-offline --no-audit
60+
61+ - name : Setup environment files
62+ run : |
63+ cp .env.example .env
64+
65+ # === INFRASTRUCTURE PHASE ===
66+ - name : Setup Docker cache
67+ uses : actions/cache@v4
68+ with :
69+ path : /tmp/.buildx-cache
70+ key : ${{ runner.os }}-buildx-${{ github.sha }}
71+ restore-keys : |
72+ ${{ runner.os }}-buildx-
73+
74+ - name : Setup database and infrastructure
75+ run : |
76+ cd lampy && task lampy:exec
77+
78+ - name : Deploy containers
79+ run : |
80+ task socketio:exec
81+
82+ - name : Run Cypress tests
3383 uses : cypress-io/github-action@v6
3484 continue-on-error : true
35- - name : Set date and branch variables
36- run : |
37- echo "CURRENT_DATE=$(date '+%Y-%m-%d_%H-%M-%S')" >> $GITHUB_ENV
38- echo "CURRENT_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
39- - name : Archive screenshots
85+ with :
86+ wait-on-timeout : 120
87+ browser : chrome
88+ record : false
89+ parallel : false
90+ config : ' screenshotOnRunFailure=true,video=true,videoCompression=32,defaultCommandTimeout=10000,requestTimeout=10000,responseTimeout=10000,retries={"runMode":2,"openMode":0}'
91+ env :
92+ CYPRESS_CACHE_FOLDER : ~/.cache/Cypress
93+ CYPRESS_RECORD_KEY : ${{ secrets.CYPRESS_RECORD_KEY }}
94+
95+ # === ARTIFACTS PHASE ===
96+ - name : Archive test results
4097 uses : actions/upload-artifact@v4
98+ if : always()
4199 with :
42- name : " socketio-${{ env.CURRENT_BRANCH }}_${{ env.CURRENT_DATE }}"
43- path : cypress/
100+ name : " test-results-${{ github.run_number }}-${{ github.sha }}"
101+ path : |
102+ cypress/screenshots
103+ cypress/videos
104+ cypress/reports
44105 retention-days : 7
106+ if-no-files-found : ignore
107+ compression-level : 6
0 commit comments