Skip to content

Commit 03e2e9d

Browse files
committed
chore: update dependencies and add devDependencies for improved development workflow
- Moved "korojscommands" to devDependencies - Added various development tools including Cypress, markdownlint-cli, and semantic-git-commit-cli - Created a new taskfiles directory with a subproject commit
1 parent 9fa94fd commit 03e2e9d

File tree

17 files changed

+11426
-9055
lines changed

17 files changed

+11426
-9055
lines changed

.env.example

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
STACK=phpfpm
22
FOLDERPHAR=apps
3-
FILESQL=database_init/01_phpfpm.sql
4-
FOLDERLAMPY=lampy
5-
DOCKERCOMPOSEFILES=docker-compose.yml docker-compose-lampy.yml
3+
FOLDERSQL=database_init
4+
FILESQL=01_phpfpm.sql
5+
FOLDERLAMPY=./lampy
6+
SERVERNAME=phpfpm.traefik.me
7+
DOCKERCOMPOSEFILE=docker-compose-lampy.yml

.github/workflows/ci.yml

Lines changed: 102 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,120 @@
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+
PHP_VERSION: '8.3'
18+
319
jobs:
4-
tests:
20+
ci:
521
runs-on: ubuntu-24.04
22+
timeout-minutes: 60
23+
env:
24+
DOCKER_INTERACTIVE: false
625
steps:
26+
# === SETUP PHASE ===
727
- name: Checkout
828
uses: actions/checkout@v4
929
with:
1030
submodules: recursive
31+
32+
- name: Setup Docker Compose
33+
run: |
34+
if ! command -v docker-compose &> /dev/null; then
35+
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
36+
sudo chmod +x /usr/local/bin/docker-compose
37+
fi
38+
docker-compose --version
39+
40+
- name: Setup Task
41+
uses: go-task/setup-task@v1
42+
43+
- name: Setup Node.js
44+
uses: actions/setup-node@v4
45+
with:
46+
node-version: ${{ env.NODE_VERSION }}
47+
cache: 'npm'
48+
cache-dependency-path: 'package-lock.json'
49+
1150
- name: Repository lampy
1251
uses: actions/checkout@v4
1352
with:
1453
submodules: recursive
15-
ref: 'v2.0'
1654
repository: koromerzhin/lampy
55+
ref: 'v4.0'
1756
path: lampy
18-
- name: Install npm dependencies
19-
run: npm install
20-
- name: 'set .env'
21-
run: 'cp .env.example .env'
22-
- name: 'SET BDD'
23-
run: npm run bdd:mariadb
24-
- name: 'Launch Lampy'
25-
run: cd lampy && npm run exec
26-
- name: 'Image pull'
27-
run: npm run docker:getpull-image
28-
- name: 'Build containers'
29-
run: npm run docker:deploy
30-
- name: 'Waiting'
31-
run: npm run docker:waiting
32-
- name: linter readme.md
33-
run: npm run lint:markdown
34-
- name: Cypress run
57+
58+
# === BUILD PHASE ===
59+
- name: Install dependencies
60+
run: npm ci --prefer-offline --no-audit
61+
62+
- name: Build assets
63+
run: npm run encore:build
64+
env:
65+
NODE_ENV: production
66+
67+
- name: Setup environment files
68+
run: |
69+
cp apps/.env.test apps/.env
70+
cp .env.example .env
71+
echo "APP_ENV=test" >> apps/.env
72+
73+
# === INFRASTRUCTURE PHASE ===
74+
- name: Setup Docker cache
75+
uses: actions/cache@v4
76+
with:
77+
path: /tmp/.buildx-cache
78+
key: ${{ runner.os }}-buildx-${{ github.sha }}
79+
restore-keys: |
80+
${{ runner.os }}-buildx-
81+
82+
- name: Setup database and infrastructure
83+
run: |
84+
task phpfpm:copysql
85+
cd lampy && task lampy:exec
86+
87+
- name: Deploy containers
88+
run: |
89+
task phpfpm:getpull-image
90+
task phpfpm:getapacheconf
91+
task phpfpm:install-first
92+
task phpfpm:deploy
93+
task phpfpm:waiting
94+
95+
- name: Run Cypress tests
3596
uses: cypress-io/github-action@v6
3697
continue-on-error: true
37-
- name: Set date and branch variables
38-
run: |
39-
echo "CURRENT_DATE=$(date '+%Y-%m-%d_%H-%M-%S')" >> $GITHUB_ENV
40-
echo "CURRENT_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
41-
- name: Archive screenshots
98+
with:
99+
wait-on-timeout: 120
100+
browser: chrome
101+
record: false
102+
parallel: false
103+
config: screenshotOnRunFailure=true,video=true,videoCompression=32,defaultCommandTimeout=10000,requestTimeout=10000,responseTimeout=10000,retries={"runMode":2,"openMode":0}
104+
env:
105+
CYPRESS_CACHE_FOLDER: ~/.cache/Cypress
106+
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
107+
108+
# === ARTIFACTS PHASE ===
109+
- name: Archive test results
42110
uses: actions/upload-artifact@v4
111+
if: always()
43112
with:
44-
name: "phpfpm-${{ env.CURRENT_BRANCH }}_${{ env.CURRENT_DATE }}"
45-
path: cypress/
113+
name: "test-results-${{ github.run_number }}-${{ github.sha }}"
114+
path: |
115+
cypress/screenshots
116+
cypress/videos
117+
cypress/reports
46118
retention-days: 7
119+
if-no-files-found: ignore
120+
compression-level: 6

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
/node_modules
22
/apps
3-
.env
3+
.env
4+
docker-compose-*.yml
5+
!docker-compose-lampy.yml

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "taskfiles"]
2+
path = taskfiles
3+
url = [email protected]:koromerzhin/taskfiles.git

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22

0 commit comments

Comments
 (0)