Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #970 from tomasnorre/github-actions
- Loading branch information
Showing
10 changed files
with
269 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Consistency | ||
|
||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
Unit: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up PHP Version ${{ matrix.php }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.4 | ||
tools: composer:v2 | ||
coverage: none | ||
|
||
- name: Environment Check | ||
run: | | ||
php --version | ||
composer --version | ||
- name: "Determine tag" | ||
id: "determine-tag" | ||
run: "echo \"::set-output name=tag::${GITHUB_REF#refs/tags/}\"" | ||
|
||
- name: Consistency Checks | ||
run: | | ||
if [ -n "${{ steps.determine-tag.outputs.tag }}" ] && [[ "${{ steps.determine-tag.outputs.tag }}" =~ ^v?([0-9]+\.)([0-9]+\.)([0-9]+)$ ]]; then | ||
composer set-version $(echo ${{ steps.determine-tag.outputs.tag }} | sed s/^v//g) | ||
test -z "$(git diff --shortstat 2> /dev/null | tail -n1)"; | ||
fi | ||
composer extension-verify-composer-json | ||
composer extension-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Deploy to TER | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v?[0-9]+.[0-9]+.[0-9]+" | ||
|
||
jobs: | ||
TER: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.4 | ||
coverage: none | ||
|
||
- name: "Determine tag" | ||
id: "determine-tag" | ||
run: "echo \"::set-output name=tag::${GITHUB_REF#refs/tags/}\"" | ||
|
||
- name: Deploy to TER | ||
run: | | ||
if [ -n "${{ secrets.TYPO3_ORG_USERNAME }}" ] && [ -n "${{ secrets.TYPO3_ORG_PASSWORD }}" ]; then | ||
echo -e "Preparing upload of release ${{ steps.determine-tag.outputs.tag }} to TER\n"; | ||
# Install ter client | ||
composer global require helhum/ter-client | ||
# Build extension files | ||
composer extension-release | ||
# Upload | ||
TAG_MESSAGE=`git tag -n10 -l ${{ steps.determine-tag.outputs.tag }} | sed 's/^[v]*[0-9.]*[ ]*//g'` | ||
echo "Uploading release ${{ steps.determine-tag.outputs.tag }} to TER" | ||
$HOME/.composer/vendor/helhum/ter-client/ter-client upload typo3_console ../extension -u "$TYPO3_ORG_USERNAME" -p "$TYPO3_ORG_PASSWORD" -m "$TAG_MESSAGE" | ||
fi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Sonar Cloud | ||
|
||
on: | ||
push: | ||
branches: | ||
- latest | ||
- develop | ||
- /^v?([0-9]+\.){1,2}(x|[0-9]+)-?[a-z]*[1-9]*$/ | ||
|
||
jobs: | ||
Sonar-cloud: | ||
name: Sonar Cloud | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Start database server | ||
run: sudo /etc/init.d/mysql start | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.4 | ||
- run: | | ||
if [ -n "${{ secrets.SONAR_TOKEN }}" ]; then | ||
export COMPOSER_ROOT_VERSION=6.4.0 | ||
composer update | ||
.Build/bin/phpunit --whitelist Classes --coverage-clover .Build/clover.xml --log-junit .Build/junit.xml | ||
fi | ||
- name: Setup sonarqube | ||
uses: warchant/setup-sonar-scanner@v3 | ||
- name: Run sonarqube | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
run: sonar-scanner | ||
-Dsonar.host.url=https://sonarcloud.io/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "**" | ||
push: | ||
branches: | ||
- "latest" | ||
- "**" | ||
|
||
jobs: | ||
Unit: | ||
runs-on: ubuntu-18.04 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
typo3: [ '^10.4.1', '^11' ] | ||
php: [ '7.2', '7.3', '7.4' ] | ||
dependency-version: [ prefer-lowest, prefer-stable ] | ||
experimental: [ false ] | ||
include: | ||
- php: 7.4 | ||
typo3: dev-master | ||
dependency-version: prefer-stable | ||
experimental: true | ||
exclude: | ||
- typo3: '^11' | ||
php: '7.2' | ||
- typo3: '^11' | ||
php: '7.3' | ||
|
||
continue-on-error: ${{ matrix.experimental }} | ||
|
||
name: PHP ${{ matrix.php }} - TYPO3 ${{ matrix.typo3 }} - ${{ matrix.dependency-version }} | ||
|
||
steps: | ||
- name: Start database server | ||
run: sudo /etc/init.d/mysql start | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up PHP Version ${{ matrix.php }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
tools: composer:v2 | ||
coverage: none | ||
|
||
- name: Environment Check | ||
run: | | ||
php --version | ||
composer --version | ||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Install | ||
run: | | ||
export COMPOSER_ROOT_VERSION=6.4.0 | ||
composer require --no-update \ | ||
typo3/cms-backend="${{ matrix.typo3 }}" \ | ||
typo3/cms-core="${{ matrix.typo3 }}" \ | ||
typo3/cms-extbase="${{ matrix.typo3 }}" \ | ||
typo3/cms-extensionmanager="${{ matrix.typo3 }}" \ | ||
typo3/cms-fluid="${{ matrix.typo3 }}" \ | ||
typo3/cms-frontend="${{ matrix.typo3 }}" \ | ||
typo3/cms-install="${{ matrix.typo3 }}" \ | ||
typo3/cms-recordlist="${{ matrix.typo3 }}" | ||
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction | ||
git checkout composer.json | ||
- name: Lint | ||
run: .Build/bin/parallel-lint --exclude .Build . | ||
|
||
# This fails when command reference is not up to date | ||
- name: Test Command Reference | ||
run: | | ||
./typo3cms commandreference:render > /dev/null 2>&1 && test -z "$(git diff --shortstat 2> /dev/null | tail -n1)" | ||
git diff | ||
- name: Test | ||
run: .Build/bin/phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Update | ||
|
||
on: [ push ] | ||
|
||
jobs: | ||
Unit: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
path: ./typo3-console | ||
|
||
- name: Checkout | ||
uses: actions/checkout@master | ||
with: | ||
repository: TYPO3-Console/Extension | ||
token: ${{ secrets.EXTENSION_UPDATE_TOKEN }} | ||
path: ./extension | ||
|
||
- name: Set up PHP Version ${{ matrix.php }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.4 | ||
tools: composer:v2 | ||
coverage: none | ||
|
||
- name: Environment Check | ||
run: | | ||
php --version | ||
composer --version | ||
- name: Determine tag name | ||
if: github.event_name != 'pull_request' | ||
id: determine-tag | ||
run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}" | ||
|
||
- name: Determine branch name | ||
if: github.event_name != 'pull_request' | ||
id: determine-branch | ||
run: echo "::set-output name=branch::${GITHUB_REF#refs/heads/}" | ||
|
||
- name: Update Extension repo | ||
run: | | ||
cd ./typo3-console | ||
if [[ $GITHUB_REF == *"refs/heads"* ]]; then | ||
cd ../extension && git fetch origin && git checkout origin/${{ steps.determine-branch.outputs.branch }} || true && cd - | ||
fi; | ||
composer extension-release | ||
cd ../extension | ||
git checkout README.md | ||
git add . | ||
git config user.email "typo3@helhum.io" | ||
git config user.name "Helmut Hummel" | ||
if [[ $GITHUB_REF == *"refs/tags"* ]]; then | ||
git commit -m "Release extension version ${{ steps.determine-tag.outputs.tag }}" | ||
git tag ${{ steps.determine-tag.outputs.tag }} | ||
git push --tags | ||
else | ||
git commit -m "Update extension based on commit $GITHUB_SHA" | ||
git push origin HEAD:${{ steps.determine-branch.outputs.branch }} | ||
fi; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters