Skip to content

Commit

Permalink
Move tests to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu authored and greg0ire committed Nov 30, 2020
1 parent 9f77e1a commit 94372f5
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
* text=auto

/Tests export-ignore
/.github export-ignore
.doctrine-project.json export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
phpcs.xml.dist export-ignore
phpunit.xml.dist export-ignore
123 changes: 123 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: "Continuous Integration"

on:
pull_request:
branches:
- "*.x"
- "master"
push:

env:
fail-fast: true

jobs:
phpunit:
name: "PHPUnit"
runs-on: "${{ matrix.os }}"

strategy:
matrix:
os:
- "ubuntu-20.04"
php-version:
- "7.2"
- "7.3"
- "7.4"
symfony-version:
- "4.4.x"
- "5.1.x"
driver-version:
- "stable"
deps:
- "normal"
include:
- deps: "low"
os: "ubuntu-20.04"
php-version: "7.2"
driver-version: "1.5.0"
symfony-version: "4.4.*"

services:
mongodb:
image: "mongo"
ports:
- "27017:27017"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 2

- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-version }}
extensions: "mongodb-${{ matrix.driver-version }}"
key: "extcache-v1"

- name: Cache extensions
uses: actions/cache@v2
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
tools: "pecl"
extensions: "mongodb-${{ matrix.driver-version }}"
coverage: "xdebug"
ini-values: "zend.assertions=1"

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

- name: "Install Symfony"
run: "composer require symfony/symfony:${{ matrix.symfony-version }} --no-update"

- name: "Install dependencies with composer"
run: "composer update --no-interaction --no-progress --prefer-stable"
if: "${{ matrix.deps == 'normal' }}"

- name: "Install lowest possible dependencies with composer"
run: "composer update --no-interaction --no-progress --prefer-dist --prefer-stable --prefer-lowest"
if: "${{ matrix.deps == 'low' }}"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit --coverage-clover=coverage.xml"

- name: "Upload coverage file"
uses: "actions/upload-artifact@v2"
with:
name: "phpunit-${{ matrix.php-version }}.coverage"
path: "coverage.xml"

upload_coverage:
name: "Upload coverage to Codecov"
runs-on: "ubuntu-20.04"
needs:
- "phpunit"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 2

- name: "Download coverage files"
uses: "actions/download-artifact@v2"
with:
path: "reports"

- name: "Upload to Codecov"
uses: "codecov/codecov-action@v1"
with:
directory: reports
63 changes: 0 additions & 63 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DoctrineMongoDBBundle
This bundle integrates the [Doctrine2 MongoDB Object Document Mapper (ODM) library](https://github.com/doctrine/mongodb-odm)
into Symfony so that you can persist and retrieve objects to and from MongoDB.

[![Build Status](https://secure.travis-ci.org/doctrine/DoctrineMongoDBBundle.png?branch=master)](http://travis-ci.org/doctrine/DoctrineMongoDBBundle)
[![Build Status](https://github.com/doctrine/DoctrineMongoDBBundle/workflows/Continuous%20Integration/badge.svg)](https://github.com/doctrine/DoctrineMongoDBBundle/actions)

Documentation on how to install and use this bundle is available in the
Symfony [documentation](http://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.html).
Expand Down

0 comments on commit 94372f5

Please sign in to comment.