From 493234a4db32527d536eaccdb54e1334ee298512 Mon Sep 17 00:00:00 2001 From: Ingolf Steinhardt Date: Thu, 5 Aug 2021 17:45:14 +0200 Subject: [PATCH] Switch to github-actions --- .github/workflows/diagnostics.yml | 52 ++++++++++++++++++++++++++ .travis.yml | 62 ------------------------------- README.md | 2 +- 3 files changed, 53 insertions(+), 63 deletions(-) create mode 100644 .github/workflows/diagnostics.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/diagnostics.yml b/.github/workflows/diagnostics.yml new file mode 100644 index 0000000..fc02d9e --- /dev/null +++ b/.github/workflows/diagnostics.yml @@ -0,0 +1,52 @@ +name: MetaModels attribute_contentarticle + +on: + push: + branches-ignore: + - '**-translation' + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + php: [7.3, 7.4] + contao: [~4.4.0, ~4.9.0] + + steps: + - name: PHP ${{ matrix.php }} ${{ matrix.contao }} Pull source + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + # see https://github.com/shivammathur/setup-php + - name: PHP ${{ matrix.php }} ${{ matrix.contao }} Setup PHP. + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + + - name: PHP ${{ matrix.php }} ${{ matrix.contao }} Cache composer cache directory + uses: actions/cache@v1 + env: + cache-name: composer-cache-dir + with: + path: ~/.cache/composer + key: ${{ runner.os }}-build-${{ env.cache-name }} + + - name: PHP ${{ matrix.php }} ${{ matrix.contao }} Cache vendor directory + uses: actions/cache@v1 + env: + cache-name: composer-vendor + with: + path: vendor + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + + - name: PHP ${{ matrix.php }} ${{ matrix.contao }} Install composer dependencies + run: composer update --prefer-dist --no-interaction --no-suggest + + - name: PHP ${{ matrix.php }} ${{ matrix.contao }} Run tests + run: ant -keep-going diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6c9c46e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,62 +0,0 @@ -dist: xenial - -addons: - apt: - packages: - - ant-optional - -language: php - -php: - - "7.3" - - "7.2" - - "7.1" - -env: - - CONTAO_VERSION=~4.10.0 - - CONTAO_VERSION=~4.9.0 - - CONTAO_VERSION=~4.4.0 - -# Exclude impossible Contao Version combinations. -matrix: - exclude: - - php: "7.1" - env: CONTAO_VERSION=~4.10.0 - fast_finish: true - allow_failures: - - env: CONTAO_VERSION=~4.10.0 - -before_script: - - echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - - travis_retry composer self-update && composer --version - - travis_retry composer require contao/core-bundle $CONTAO_VERSION --no-update - - > - if [ "x${TRAVIS_TAG}" != "x" ]; then - export COMPOSER_ROOT_VERSION=${TRAVIS_TAG} - else - export COMPOSER_ROOT_VERSION=$([[ ${TRAVIS_BRANCH} =~ (hotfix|release)/([0-9.]*(-(alpha|beta|rc)[0-9]+)?) ]] \ - && echo ${BASH_REMATCH[2]} \ - || echo dev-${TRAVIS_BRANCH}) - fi - - echo "Using root version ${COMPOSER_ROOT_VERSION}" - - > - echo "PHP version: ${TRAVIS_PHP_VERSION}"; - if [ "x${TRAVIS_PHP_VERSION}" == "xnightly" ]; then - travis_retry composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-suggest - else - travis_retry composer update --prefer-dist --no-interaction --no-suggest - fi - -script: ant -keep-going - -# Hack to make things work again - we can not use a shallow repository. -git: - depth: 2147483647 - -branches: - except: - - /.*-translation/ - -cache: - directories: - - vendor diff --git a/README.md b/README.md index bf37e16..fdd6d86 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/MetaModels/attribute_contentarticle.svg)](https://travis-ci.org/MetaModels/attribute_contentarticle) +[![Build Status](https://github.com/MetaModels/attribute_contentarticle/actions/workflows/diagnostics.yml/badge.svg)](https://github.com/MetaModels/attribute_contentarticle/actions) [![Latest Version tagged](http://img.shields.io/github/tag/MetaModels/attribute_contentarticle.svg)](https://github.com/MetaModels/attribute_contentarticle/tags) [![Latest Version on Packagist](http://img.shields.io/packagist/v/MetaModels/attribute_contentarticle.svg)](https://packagist.org/packages/MetaModels/attribute_contentarticle) [![Installations via composer per month](http://img.shields.io/packagist/dm/MetaModels/attribute_contentarticle.svg)](https://packagist.org/packages/MetaModels/attribute_contentarticle)