Skip to content

Commit

Permalink
Migrate CI to GitHub Actions (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
minchao authored Jan 26, 2021
1 parent b176a9a commit bff8bed
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 32 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
on: [ push, pull_request ]
name: tests

jobs:
test:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest ]
php-versions: [ 8, 7.4, 7.3, 7.2, 7.1 ]
phpunit-versions: [ latest ]

steps:
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: xdebug
- uses: actions/checkout@v2

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --prefer-dist

- name: Run lint
run: composer run lint

- name: Run static analysis (phpstan)
run: composer run phpstan

- name: Run test
run: composer run test
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# shopee-php

[![Build Status](https://travis-ci.org/minchao/shopee-php.svg?branch=master)](https://travis-ci.org/minchao/shopee-php)
[![tests](https://github.com/minchao/shopee-php/workflows/tests/badge.svg?branch=master)](https://github.com/minchao/shopee-php/actions?query=workflow%3Atests)
[![Latest Stable Version](https://poser.pugx.org/minchao/shopee-php/v/stable)](https://packagist.org/packages/minchao/shopee-php)
[![Latest Unstable Version](https://poser.pugx.org/minchao/shopee-php/v/unstable)](https://packagist.org/packages/minchao/shopee-php)
[![composer.lock](https://poser.pugx.org/minchao/shopee-php/composerlock)](https://packagist.org/packages/minchao/shopee-php)
Expand Down

0 comments on commit bff8bed

Please sign in to comment.