Skip to content

Commit

Permalink
Merge pull request #102 from symfonycorp/ci-to-github-actions
Browse files Browse the repository at this point in the history
Move CI to Github actions
  • Loading branch information
fabpot committed Oct 28, 2022
2 parents 80714ad + 39ebd79 commit 5ad4cd9
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 89 deletions.
89 changes: 0 additions & 89 deletions .circleci/config.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
on: [pull_request]
name: Insight SDK

jobs:
php-cs:
name: Coding style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: shivammathur/setup-php@v2
with:
php-version: '7.2'
tools: php-cs-fixer:2.13.1
coverage: none
- name: php-cs-fixer
run: php-cs-fixer fix --dry-run --diff

tests-phpunit:
name: Unit tests
runs-on: ubuntu-latest

strategy:
matrix:
php-version: ["7.2", "7.3", "7.4", "8.0", "8.1"]

steps:
- uses: actions/checkout@master
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: phpunit-bridge
coverage: none

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

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

- name: Install dependencies
run: |
composer install --prefer-dist --no-interaction --no-ansi --no-progress
- name: Run the tests suite
run: |
php vendor/bin/simple-phpunit -v --log-junit ./phpunit/junit.xml
49 changes: 49 additions & 0 deletions .github/workflows/only-master.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
on:
push:
branches:
- master
name: Insight SDK (release)

jobs:
release:
name: Release
runs-on: ubuntu-latest

env:
AWS_DEFAULT_REGION: 'eu-west-1'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

steps:
- uses: actions/checkout@master
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none

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

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

- name: Install dependencies
run: composer install

- name: Build
run: |
wget https://github.com/box-project/box/releases/download/3.13.0/box.phar -O /tmp/box.phar
php /tmp/box.phar build
- name: Test
run: build/insight.phar list

- name: Release
run: |
aws s3 cp build/insight.phar s3://get.insight.symfony.com/insight.phar

0 comments on commit 5ad4cd9

Please sign in to comment.