diff --git a/.github/workflows/Consistency.yaml b/.github/workflows/Consistency.yaml new file mode 100644 index 00000000..46a26c48 --- /dev/null +++ b/.github/workflows/Consistency.yaml @@ -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 diff --git a/.github/workflows/Deploy.yml b/.github/workflows/Deploy.yml new file mode 100644 index 00000000..b3cebcde --- /dev/null +++ b/.github/workflows/Deploy.yml @@ -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; diff --git a/.github/workflows/SonarCloud.yml b/.github/workflows/SonarCloud.yml new file mode 100644 index 00000000..a266618a --- /dev/null +++ b/.github/workflows/SonarCloud.yml @@ -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/ diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml new file mode 100644 index 00000000..f484f18d --- /dev/null +++ b/.github/workflows/Tests.yml @@ -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 diff --git a/.github/workflows/Update.yml b/.github/workflows/Update.yml new file mode 100644 index 00000000..0eed21b8 --- /dev/null +++ b/.github/workflows/Update.yml @@ -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; diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml deleted file mode 100644 index 63316f81..00000000 --- a/.github/workflows/setup.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Tests - -on: - pull_request: - branches: - - "**" - push: - branches: - - "**" - -jobs: - Unit: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - php: [ '7.4' ] - - steps: - - 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 - - - name: Environment Check - run: | - php --version - composer --version \ No newline at end of file diff --git a/composer.json b/composer.json index 2a250fcb..db3073c0 100644 --- a/composer.json +++ b/composer.json @@ -39,6 +39,7 @@ "typo3/cms-install": "^10.4.1 || >=11.0.0 <11.2", "doctrine/annotations": "^1.4", + "doctrine/dbal": "<2.13", "symfony/console": "^4.4 || ^5.0", "symfony/process": "^4.4 || ^5.0", "helhum/config-loader": ">=0.9 <0.13" diff --git a/.travis.yml b/disabeld.travis.yml similarity index 100% rename from .travis.yml rename to disabeld.travis.yml diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 20f074ca..b2ffcf69 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -17,8 +17,8 @@ - - + + diff --git a/sonar-project.properties b/sonar-project.properties index da5dfb1a..f8edf01b 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,3 +1,4 @@ +sonar.organization=helhum-github sonar.projectKey=typo3-console sonar.projectName=TYPO3 Console sonar.projectVersion=6.4.0