Fronta e-mailů 2 #1011
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
concurrency: | |
group: test-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
workdir: | |
name: "Build" | |
runs-on: ubuntu-22.04 | |
container: | |
image: skaut/lebeda:8.1 | |
steps: | |
- uses: actions/checkout@v3 | |
# Copy & paste from https://github.com/actions/cache/blob/master/examples.md#php---composer | |
- name: Get composer cache | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Install yarn | |
run: | | |
apt-get update | |
apt-get install -y npm | |
npm install --global yarn | |
#Copy & paste from https://github.com/actions/cache/blob/master/examples.md#node---yarn | |
- name: Get yarn cache | |
id: yarn-cache | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- run: composer install | |
- run: yarn install | |
- run: yarn build | |
- name: Remove development docker-compose override | |
run: rm docker-compose.override.yml | |
- name: Fix permissions | |
run: chown 1000:1000 . -R && chmod 777 . -R | |
- name: Create tarball | |
run: tar -czpf /tmp/workdir.tar.gz . && mv /tmp/workdir.tar.gz . | |
- name: Upload workdir | |
uses: actions/upload-artifact@v1 | |
with: | |
name: workdir | |
path: workdir.tar.gz | |
tests-unit: | |
name: "Unit tests" | |
runs-on: ubuntu-22.04 | |
container: | |
image: skaut/lebeda:8.1 | |
needs: workdir | |
steps: | |
- name: Download workdir | |
uses: actions/download-artifact@v1 | |
with: | |
name: workdir | |
path: . | |
- name: Extract workdir | |
run: tar -xzf workdir.tar.gz | |
- run: phing tests-unit | |
tests-integration: | |
name: "Integration tests" | |
runs-on: ubuntu-22.04 | |
needs: workdir | |
steps: | |
- name: Download workdir | |
uses: actions/download-artifact@v1 | |
with: | |
name: workdir | |
path: . | |
- name: Extract workdir | |
run: tar -xzpf workdir.tar.gz | |
- name: Start application containers | |
run: docker-compose up -d mysql-test | |
- run: docker-compose run -T -u www-data app phing tests-integration | |
code-coverage: | |
name: "Code coverage" | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-22.04 | |
needs: workdir | |
steps: | |
- name: Download workdir | |
uses: actions/download-artifact@v1 | |
with: | |
name: workdir | |
path: . | |
- name: Extract workdir | |
run: tar -xzpf workdir.tar.gz | |
- name: Start application containers | |
run: docker-compose up -d mysql-test | |
- name: Run tests with coverage | |
run: docker-compose run -T -u www-data app phing tests-with-coverage | |
- name: Upload code coverage | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: tests/_output/coverage.xml | |
fail_ci_if_error: true | |
static-analysis: | |
name: "PHPStan analysis" | |
runs-on: ubuntu-22.04 | |
container: | |
image: skaut/lebeda:8.1 | |
needs: workdir | |
steps: | |
- name: Download workdir | |
uses: actions/download-artifact@v1 | |
with: | |
name: workdir | |
path: . | |
- name: Extract workdir | |
run: tar -xzf workdir.tar.gz | |
- run: phing static-analysis | |
coding-standard: | |
name: "Coding standard" | |
runs-on: ubuntu-22.04 | |
container: | |
image: skaut/lebeda:8.1 | |
needs: workdir | |
steps: | |
- name: Download workdir | |
uses: actions/download-artifact@v1 | |
with: | |
name: workdir | |
path: . | |
- name: Extract workdir | |
run: tar -xzf workdir.tar.gz | |
- run: phing coding-standard | |
doctrine-checks: | |
name: "Doctrine checks" | |
runs-on: ubuntu-22.04 | |
container: | |
image: skaut/lebeda:8.1 | |
services: | |
mysql-test: | |
image: mysql:8.0 | |
env: | |
MYSQL_ROOT_PASSWORD: 'root' | |
MYSQL_DATABASE: srs | |
TZ: Europe/Paris | |
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 | |
needs: workdir | |
steps: | |
- name: Download workdir | |
uses: actions/download-artifact@v1 | |
with: | |
name: workdir | |
path: . | |
- name: Extract workdir | |
run: tar -xzf workdir.tar.gz | |
- name: Create local.neon config | |
run: mv app/config/ci.local.neon app/config/local.neon | |
- name: Run migrations:migrate | |
run: php www/console.php migrations:migrate --no-interaction | |
- name: Run orm:validate | |
run: php www/console.php orm:validate |