├── CHANGELOG.md ├── Dockerfile ├── LICENCE ├── README.md └── entrypoint.sh /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 5 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 | 7 | ## [1.0.0] - 2019-08-19 8 | 9 | ### Added 10 | - N/A 11 | 12 | ### Changed 13 | - Initial release 14 | 15 | ### Removed 16 | - N/A 17 | 18 | [1.0.0]: https://github.com/joelwmale/codeception-action/compare/1.0.0...1.0.0 -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.3-cli-alpine 2 | 3 | LABEL version="1.0.0" 4 | LABEL repository="http://github.com/joelwmale/codeception-action" 5 | LABEL homepage="http://github.com/joelwmale/codeception-action" 6 | LABEL maintainer="Joel Male" 7 | LABEL "com.github.actions.name"="Codeception Action" 8 | LABEL "com.github.actions.description"="Run your codeception tests" 9 | LABEL "com.github.actions.icon"="check-circle" 10 | LABEL "com.github.actions.color"="green" 11 | 12 | ADD entrypoint.sh /entrypoint.sh 13 | RUN chmod +x /entrypoint.sh 14 | 15 | ENTRYPOINT ["/entrypoint.sh"] 16 | -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 joelwmale 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🚀 Codeception Action 2 | 3 | [![GitHub Release][ico-release]][link-github-release] 4 | [![License][ico-license]](LICENSE) 5 | 6 | Runs your codeception tests. 7 | 8 | Supports all [workflow event types](https://developer.github.com/webhooks/#events). 9 | 10 |
11 | 12 | ## Usage 13 | 14 | Via GitHub Workflow 15 | 16 | ```yml 17 | - name: tests 18 | uses: joelwmale/codeception-action@master 19 | ``` 20 | 21 | ## Optional Configuration 22 | 23 | If a `FRAMEWORK` is configured then you should also configure `ENV_FILE` 24 | 25 | ```yml 26 | FRAMEWORK: laravel 27 | ENV_FILE: .env.test 28 | ``` 29 | 30 | > Supplying a framework & env file is not required. It will by default just run codeception from the vendor folder. 31 | 32 | ### Framework - Laravel 33 | 34 | If the specified framework is `laravel` then additionally the following happens: 35 | * The supplied env is copied to .env 36 | * The APP_KEY is generated 37 | * The database is migrated 38 | 39 | ## Recommendations 40 | It is **highly** recommended to use the action is an explicit commit SHA-1 41 | 42 | `uses = "joelwmale/codeception-action@master@{sha-1}"` to find a commit click here: https://github.com/joelwmale/codeception-action/commits/master 43 | 44 | ## Issues 45 | 46 | If you find any issues or have an improvement feel free to [submit an issue](https://github.com/joelwmale/codeception-action/issues/new) 47 | 48 | ## License 49 | 50 | The MIT License (MIT). Please see [License File](LICENSE) for more information. 51 | 52 | [ico-release]: https://img.shields.io/github/tag/joelwmale/codeception-action.svg 53 | [ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg 54 | [link-github-release]: https://github.com/joelwmale/codeception-action/releases -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -l 2 | 3 | # set env file | default to .env.testing 4 | ENV_FILE="${ENV_FILE:-.env.testing}" 5 | 6 | # if the framework is laravel and env_file is set 7 | if [ -n "$FRAMEWORK" ] && [ "$FRAMEWORK" == "laravel" ]; then 8 | # copy the env file 9 | cp $ENV_FILE .env 10 | # generate a new key 11 | php artisan key:generate 12 | # run migrations 13 | php artisan migrate 14 | fi 15 | 16 | # Run codeception tests 17 | vendor/bin/codecept run $* 18 | --------------------------------------------------------------------------------