fix(ci): replace actions/checkout with manual git checkout
The Gitea Actions Runner doesn't have Node.js installed, causing actions/checkout@v3 (a JavaScript action) to fail with "Cannot find: node in PATH". Replace with native shell-based git checkout that works without Node.js and uses Gitea context variables for repository URL.
This commit is contained in:
@@ -11,8 +11,17 @@ jobs:
|
|||||||
deploy:
|
deploy:
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
steps:
|
steps:
|
||||||
|
# Manual checkout - works without Node.js
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
run: |
|
||||||
|
echo "📥 Checking out repository..."
|
||||||
|
if [ -d ".git" ]; then
|
||||||
|
git fetch origin
|
||||||
|
git checkout ${{ github.ref_name }}
|
||||||
|
git reset --hard origin/${{ github.ref_name }}
|
||||||
|
else
|
||||||
|
git clone --branch ${{ github.ref_name }} --single-branch ${{ github.server_url }}/${{ github.repository }}.git .
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Determine environment
|
- name: Determine environment
|
||||||
id: env
|
id: env
|
||||||
|
|||||||
@@ -11,22 +11,41 @@ jobs:
|
|||||||
test-basic:
|
test-basic:
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
steps:
|
steps:
|
||||||
|
# Manual checkout - works without Node.js
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
run: |
|
||||||
|
echo "📥 Checking out repository..."
|
||||||
|
if [ -d ".git" ]; then
|
||||||
|
git fetch origin
|
||||||
|
git checkout ${{ github.ref_name }}
|
||||||
|
git reset --hard origin/${{ github.ref_name }}
|
||||||
|
else
|
||||||
|
git clone --branch ${{ github.ref_name }} --single-branch ${{ github.server_url }}/${{ github.repository }}.git .
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Test basic runner
|
- name: Test basic runner
|
||||||
run: |
|
run: |
|
||||||
echo "✅ Runner is working!"
|
echo "✅ Runner is working!"
|
||||||
echo "Runner OS: $(uname -a)"
|
echo "Runner OS: $(uname -a)"
|
||||||
echo "Docker version: $(docker --version)"
|
echo "Docker version: $(docker --version || echo 'Docker not available')"
|
||||||
echo "Current directory: $(pwd)"
|
echo "Current directory: $(pwd)"
|
||||||
echo "Git branch: $(git rev-parse --abbrev-ref HEAD)"
|
echo "Git branch: $(git rev-parse --abbrev-ref HEAD)"
|
||||||
|
echo "Git commit: $(git rev-parse --short HEAD)"
|
||||||
|
|
||||||
test-php:
|
test-php:
|
||||||
runs-on: php-ci
|
runs-on: php-ci
|
||||||
steps:
|
steps:
|
||||||
|
# Manual checkout - works without Node.js
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
run: |
|
||||||
|
echo "📥 Checking out repository..."
|
||||||
|
if [ -d ".git" ]; then
|
||||||
|
git fetch origin
|
||||||
|
git checkout ${{ github.ref_name }}
|
||||||
|
git reset --hard origin/${{ github.ref_name }}
|
||||||
|
else
|
||||||
|
git clone --branch ${{ github.ref_name }} --single-branch ${{ github.server_url }}/${{ github.repository }}.git .
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Test PHP environment
|
- name: Test PHP environment
|
||||||
run: |
|
run: |
|
||||||
@@ -34,5 +53,5 @@ jobs:
|
|||||||
php -v
|
php -v
|
||||||
composer --version
|
composer --version
|
||||||
echo "PHP Extensions:"
|
echo "PHP Extensions:"
|
||||||
php -m | grep -E "(pdo|redis|zip|gd|mbstring)"
|
php -m | grep -E "(pdo|redis|zip|gd|mbstring)" || echo "Some extensions not found"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user