Compare commits
14 Commits
128229a7c0
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a5dbcb04cd | |||
| 332f3f48d7 | |||
| 7eba2caaec | |||
| 11ee7fbd06 | |||
| 785f3c06dc | |||
| 4078b93507 | |||
| e97d7e0687 | |||
| a31e1117ac | |||
| 1fc447d835 | |||
| a84d2008f9 | |||
| b77bfef4a9 | |||
| 3900bfdd69 | |||
| 2337941910 | |||
| f5bc9e7b3d |
176
.gitea/workflows/workflow-test.yml
Normal file
176
.gitea/workflows/workflow-test.yml
Normal file
@@ -0,0 +1,176 @@
|
||||
name: Test Workflow
|
||||
|
||||
# Запускается при push в любую ветку и при pull request
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master ]
|
||||
pull_request:
|
||||
branches: [ main, master ]
|
||||
|
||||
# Также можно запустить вручную
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
# Простая проверка системы
|
||||
system-info:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: System Information
|
||||
run: |
|
||||
echo "=== System Info ==="
|
||||
uname -a
|
||||
echo ""
|
||||
echo "=== CPU Info ==="
|
||||
lscpu | head -10
|
||||
echo ""
|
||||
echo "=== Memory Info ==="
|
||||
free -h
|
||||
echo ""
|
||||
echo "=== Disk Space ==="
|
||||
df -h
|
||||
echo ""
|
||||
echo "=== Docker Version ==="
|
||||
docker --version
|
||||
echo ""
|
||||
echo "=== Environment Variables ==="
|
||||
env | grep -E "(CI|GITEA|GITHUB)" | sort
|
||||
|
||||
# Проверка с Node.js
|
||||
node-test:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
|
||||
- name: Node.js info
|
||||
run: |
|
||||
echo "Node.js version:"
|
||||
node --version
|
||||
echo "NPM version:"
|
||||
npm --version
|
||||
|
||||
- name: Create test package.json
|
||||
run: |
|
||||
cat > package.json << 'EOF'
|
||||
{
|
||||
"name": "test-actions",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"test": "echo \"Test passed!\" && exit 0"
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Run tests
|
||||
run: npm test
|
||||
|
||||
# Проверка с Python
|
||||
python-test:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.9'
|
||||
|
||||
- name: Python info
|
||||
run: |
|
||||
echo "Python version:"
|
||||
python --version
|
||||
echo "Pip version:"
|
||||
pip --version
|
||||
|
||||
- name: Create test script
|
||||
run: |
|
||||
cat > test_script.py << 'EOF'
|
||||
import sys
|
||||
import os
|
||||
|
||||
print("=== Python Test ===")
|
||||
print(f"Python version: {sys.version}")
|
||||
print(f"Platform: {sys.platform}")
|
||||
print("Environment variables:")
|
||||
for key in sorted(os.environ.keys()):
|
||||
if any(prefix in key.upper() for prefix in ['CI', 'GITEA', 'GITHUB']):
|
||||
print(f" {key}={os.environ[key]}")
|
||||
|
||||
print("Test completed successfully!")
|
||||
EOF
|
||||
|
||||
- name: Run Python test
|
||||
run: python test_script.py
|
||||
|
||||
# Параллельная матричная сборка
|
||||
matrix-test:
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
version: ['16', '18', '20']
|
||||
include:
|
||||
- version: '16'
|
||||
name: 'Legacy'
|
||||
- version: '18'
|
||||
name: 'Current'
|
||||
- version: '20'
|
||||
name: 'Latest'
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js ${{ matrix.version }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.version }}
|
||||
|
||||
- name: Test Node.js ${{ matrix.version }} (${{ matrix.name }})
|
||||
run: |
|
||||
echo "Testing Node.js ${{ matrix.version }} - ${{ matrix.name }}"
|
||||
node --version
|
||||
npm --version
|
||||
|
||||
# Тест с артефактами
|
||||
artifact-test:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Create test files
|
||||
run: |
|
||||
mkdir -p test-results
|
||||
echo "Test run: $(date)" > test-results/test-log.txt
|
||||
echo "System: $(uname -a)" >> test-results/test-log.txt
|
||||
echo "User: $(whoami)" >> test-results/test-log.txt
|
||||
|
||||
# Создаём JSON отчёт
|
||||
cat > test-results/report.json << EOF
|
||||
{
|
||||
"timestamp": "$(date -Iseconds)",
|
||||
"status": "success",
|
||||
"tests_run": 5,
|
||||
"tests_passed": 5,
|
||||
"tests_failed": 0
|
||||
}
|
||||
EOF
|
||||
|
||||
- name: Upload test results
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: test-results
|
||||
path: test-results/
|
||||
retention-days: 7
|
||||
23
README.md
23
README.md
@@ -1,3 +1,24 @@
|
||||
This repository contains all the scripts I use in Linux and beyond.
|
||||
Here you can find both bash scripts and scripts written in python.
|
||||
это тест бро?
|
||||
|
||||
___
|
||||
|
||||
Test Actions Repository
|
||||
Этот репозиторий создан для тестирования Gitea Actions.
|
||||
Что тестируется
|
||||
|
||||
✅ Базовая информация о системе
|
||||
✅ Node.js окружение
|
||||
✅ Python окружение
|
||||
✅ Матричные сборки
|
||||
✅ Артефакты
|
||||
|
||||
Как запустить
|
||||
|
||||
Сделайте коммит в ветку main
|
||||
Или запустите workflow вручную в разделе Actions
|
||||
|
||||
Статус сборки
|
||||
Проверьте результаты в разделе Actions вашего Gitea репозитория.
|
||||
|
||||
test5
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
ls -la
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/bash
|
||||
pwd
|
||||
ls -la
|
||||
|
||||
Reference in New Issue
Block a user