46 lines
1.5 KiB
YAML
46 lines
1.5 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
jobs:
|
|
ls:
|
|
runs-on: docker
|
|
container:
|
|
image: php:8.4-cli
|
|
steps:
|
|
- name: Install dependencies
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y git
|
|
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
|
- name: Manually checkout
|
|
env:
|
|
REPO: '${{ github.repository }}'
|
|
TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
|
BRANCH: '${{ env.GITHUB_REF_NAME }}'
|
|
GIT_SERVER: 'git.hannover.ccc.de'
|
|
run: |
|
|
git clone --branch $GITHUB_REF_NAME https://${TOKEN}@${GIT_SERVER}/${REPO}.git .
|
|
git fetch
|
|
git checkout ${{ github.head_ref }}
|
|
- name: composer install
|
|
env:
|
|
COMPOSER_CACHE_DIR: /opt/hostedtoolcache/.composer/cache/files
|
|
run: |
|
|
mkdir -p ${{ env.COMPOSER_CACHE_DIR }}
|
|
composer install
|
|
- name: lint
|
|
run: composer lint
|
|
- name: test
|
|
run: composer test
|
|
- name: GIT commit and push all changed files
|
|
env:
|
|
CI_COMMIT_MESSAGE: Continuous Integration Fixes
|
|
CI_COMMIT_AUTHOR: Continuous Integration
|
|
run: |
|
|
if [[ -n "$(git status -s)" ]]; then
|
|
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
|
|
git config --global user.email "gitbot@users.noreply.php.fail"
|
|
git commit -am "${{ env.CI_COMMIT_MESSAGE }}"
|
|
git push
|
|
fi
|