From 7e122f39d3a929aaaee906f3099780d9a4b47432 Mon Sep 17 00:00:00 2001 From: elizoller Date: Thu, 29 Apr 2021 01:22:32 +0000 Subject: [PATCH 1/3] first pass --- .github/workflows/build-dev.yml | 74 +++++++++++++++++++++++++++++++++ .travis.yml | 33 --------------- README.md | 6 +-- 3 files changed, 77 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/build-dev.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml new file mode 100644 index 0000000..a62f21b --- /dev/null +++ b/.github/workflows/build-dev.yml @@ -0,0 +1,74 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the 7.x branch + push: + branches: [ dev, main, github_actions ] + pull_request: + branches: [ dev, main, github_actions ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: ["7.3", "7.4"] + + name: PHP ${{ matrix.php-versions }} + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout code + uses: actions/checkout@v2 + with: + path: build_dir + + - name: Checkout islandora_ci + uses: actions/checkout@v2 + with: + repository: islandora/islandora_ci + ref: github-actions + path: islandora_ci + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + tools: composer:v2 + + - name: Set environment variables + run: | + echo "SCRIPT_DIR=$GITHUB_WORKSPACE/islandora_ci" >> $GITHUB_ENV + + - name: Cache Composer dependencies + uses: actions/cache@v2 + with: + path: /tmp/composer-cache + key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} + + - name: composer install + run: | + cd $GITHUB_WORKSPACE/build_dir + composer install + + - name: Line endings + run: $SCRIPT_DIR/line_endings.sh $GITHUB_WORKSPACE + + - name: Test scripts + run: | + cd $GITHUB_WORKSPACE/build_dir + composer test + + - name: codecov + uses: codecov/codecov-action@v1 + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6d0cf32..0000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -sudo: true -language: php -php: - - 7.3 - - 7.4 - -matrix: - fast_finish: true - -branches: - only: - - /main/ - - /dev/ - -before_install: - - export SCRIPT_DIR=$HOME/islandora_ci - -install: - - git clone https://github.com/Islandora/islandora_ci.git $HOME/islandora_ci - - composer install - -script: - - $SCRIPT_DIR/line_endings.sh $TRAVIS_BUILD_DIR - - composer test - -after_success: - - bash <(curl -s https://codecov.io/bash) - -notifications: - slack: - on_success: change - on_failure: always - secure: $SLACK_NOTIFICATION_KEY diff --git a/README.md b/README.md index 7523904..755adaa 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ ![Crayfish](https://user-images.githubusercontent.com/2371345/48163075-11c6cf80-e2b5-11e8-8b5b-991b366014a5.png) # Crayfish Commons -[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.2-8892BF.svg?style=flat-square)](https://php.net/) -[![Build Status](https://travis-ci.com/Islandora/Crayfish-Commons.svg?branch=main)](https://travis-ci.com/Islandora/Crayfish-Commons) +[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.38892BF.svg?style=flat-square)](https://php.net/) +[![Build Status](https://github.com/islandora/crayfish-commons/actions/workflows/build-dev.yml/badge.svg)](https://github.com/Islandora/crayfish-commons/actions) [![Contribution Guidelines](http://img.shields.io/badge/CONTRIBUTING-Guidelines-blue.svg)](./CONTRIBUTING.md) [![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](./LICENSE) -[![codecov](https://codecov.io/gh/Islandora/Crayfish-Commons/branch/main/graph/badge.svg)](https://codecov.io/gh/Islandora/Crayfish-Commons) +[![codecov](https://codecov.io/gh/Islandora/Crayfish-Commons/branch/dev/graphs/badge.svg?branch=dev)](https://codecov.io/gh/Islandora/Crayfish-Commons) ## Introduction From e4ef811b7b2549f1fa8c8b4194cf1349f9dc7f7a Mon Sep 17 00:00:00 2001 From: elizoller Date: Thu, 29 Apr 2021 01:27:01 +0000 Subject: [PATCH 2/3] cleanup --- .github/workflows/build-dev.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml index a62f21b..647fe7f 100644 --- a/.github/workflows/build-dev.yml +++ b/.github/workflows/build-dev.yml @@ -6,9 +6,9 @@ name: CI on: # Triggers the workflow on push or pull request events but only for the 7.x branch push: - branches: [ dev, main, github_actions ] + branches: [ dev, main ] pull_request: - branches: [ dev, main, github_actions ] + branches: [ dev, main ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -69,6 +69,6 @@ jobs: cd $GITHUB_WORKSPACE/build_dir composer test - - name: codecov + - name: Codecov uses: codecov/codecov-action@v1 From 4f88b26bc314b714e1901f851dc668a03234cb75 Mon Sep 17 00:00:00 2001 From: elizoller Date: Thu, 29 Apr 2021 15:31:06 +0000 Subject: [PATCH 3/3] fix php badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 755adaa..34369dc 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![Crayfish](https://user-images.githubusercontent.com/2371345/48163075-11c6cf80-e2b5-11e8-8b5b-991b366014a5.png) # Crayfish Commons -[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.38892BF.svg?style=flat-square)](https://php.net/) +[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.3-8892BF.svg?style=flat-square)](https://php.net/) [![Build Status](https://github.com/islandora/crayfish-commons/actions/workflows/build-dev.yml/badge.svg)](https://github.com/Islandora/crayfish-commons/actions) [![Contribution Guidelines](http://img.shields.io/badge/CONTRIBUTING-Guidelines-blue.svg)](./CONTRIBUTING.md) [![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](./LICENSE)