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

feat: github actions tests #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
41 changes: 41 additions & 0 deletions .github/workflows/staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deploy on Staging

on:
push:
branches:
- master
- feat/github-actions-tests

jobs:
tests:
runs-on: ubuntu-latest

container: jellybellydev/ci-cd-theory-into-practice:latest

name: "CI⚡CD: the theory put into practice"

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Prepare artifact deployable
run: |
echo "APP_ENV=staging" >> .env.local
composer install --no-dev --optimize-autoloader
composer dump-autoload --no-dev --classmap-authoritative
composer dump-env

- name: Publish artifact
uses: actions/upload-artifact@v2
with:
name: staging-artifact
path: |
bin/**
config/**
public/**
src/**
vendor/**
.env
.env.local
.env.local.php
composer.json
32 changes: 32 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
push:
pull_request:

jobs:
tests:
runs-on: ubuntu-latest

container: jellybellydev/ci-cd-theory-into-practice:latest

name: "CI⚡CD: the theory put into practice"

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: composer install

- name: Check php-cs-fixer
run: vendor/bin/php-cs-fixer fix --verbose --diff --dry-run

- name: Lint yaml config
run: bin/console lint:yaml config

- name: Phpunit
run: XDEBUG_MODE=coverage bin/phpunit --colors=never --coverage-text

- name: Psalm
run: vendor/bin/psalm
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
![Logo](./stuff/ci-cd-logo-250.png)

# CI⚡CD: the theory put into practice
GitLab:
[![pipeline status](https://gitlab.com/JellyBellyDev/ci-cd-theory-into-practice/badges/master/pipeline.svg)](https://gitlab.com/JellyBellyDev/ci-cd-theory-into-practice/-/commits/master)
[![coverage report](https://gitlab.com/JellyBellyDev/ci-cd-theory-into-practice/badges/master/coverage.svg)](https://gitlab.com/JellyBellyDev/ci-cd-theory-into-practice/-/commits/master)
[![coverage report](https://gitlab.com/JellyBellyDev/ci-cd-theory-into-practice/badges/master/coverage.svg)](https://gitlab.com/JellyBellyDev/ci-cd-theory-into-practice/-/commits/master)
GitHub:
![CI](https://github.com/JellyBellyDev/ci-cd-theory-into-practice/workflows/CI/badge.svg)

> This is a sample repository to show a possible configuration of a GitLab pipeline and deploy with Ansible for a software written in php with Symfony framework.

Expand Down