Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add github actions build #150

Merged
merged 2 commits into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: build

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer:v1
Copy link
Contributor Author

@vstelmakh vstelmakh Dec 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some package plugins incompatibilities with composer v2 at this moment, so I restricted it to v1.


- name: Git checkout
uses: actions/checkout@v2

- name: Validate composer.json and composer.lock
run: composer validate

- name: Prepare Composer cache vars
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could simplify this steps by using https://github.com/ramsey/composer-install

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #152

id: composer
run: |
echo "::set-output name=cache_dir::$(composer config cache-files-dir)"
echo "::set-output name=cache_key::$(date +'%Y-%m-%d')-composer-"

- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer.outputs.cache_dir }}
key: ${{ steps.composer.outputs.cache_key }}${{ hashFiles('**/composer.json') }}
restore-keys: ${{ steps.composer.outputs.cache_key }}

- name: Update Composer dependencies
run: composer update --prefer-dist --no-progress --no-suggest --no-interaction

- name: Run PHPUnit
run: vendor/bin/phpunit --colors=always
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Externals.io

[![Build status](https://github.com/mnapoli/externals/workflows/build/badge.svg?branch=master)](https://github.com/mnapoli/externals/actions)

## Setup

Requirements (TODO: Vagrant box):

- PHP 7.3 or above
- PHP 7.4 or above
- NPM
- Gulp (install with `npm install gulp-cli -g`)
- MySQL database
Expand Down