Skip to content

Commit

Permalink
merge devel
Browse files Browse the repository at this point in the history
  • Loading branch information
usu committed Dec 22, 2023
2 parents 18ba88a + a23bb85 commit 54953b5
Show file tree
Hide file tree
Showing 158 changed files with 15,164 additions and 8,811 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- uses: shivammathur/setup-php@v2
with:
php-version: '8.2.12'
php-version: '8.3.0'
tools: composer:2.6.0
coverage: xdebug

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/continuous-integration-optional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

- uses: shivammathur/setup-php@v2
with:
php-version: '8.2.12'
php-version: '8.3.0'
tools: composer:2.6.0
coverage: xdebug

Expand All @@ -36,7 +36,7 @@ jobs:

- uses: shivammathur/setup-php@v2
with:
php-version: '8.2.12'
php-version: '8.3.0'
tools: composer:2.6.0
coverage: xdebug

Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:

- uses: shivammathur/setup-php@v2
with:
php-version: '8.2.12'
php-version: '8.3.0'
tools: composer:2.6.0
coverage: xdebug

Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:

- uses: shivammathur/setup-php@v2
with:
php-version: '8.2.12'
php-version: '8.3.0'
tools: composer:2.6.0
coverage: xdebug

Expand Down
115 changes: 8 additions & 107 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

- uses: shivammathur/setup-php@v2
with:
php-version: '8.2.12'
php-version: '8.3.0'
tools: composer:2.6.0
coverage: none

Expand Down Expand Up @@ -197,7 +197,7 @@ jobs:

- uses: shivammathur/setup-php@v2
with:
php-version: '8.2.12'
php-version: '8.3.0'
extensions: intl-73.1
tools: composer:2.6.0
coverage: pcov
Expand Down Expand Up @@ -365,113 +365,14 @@ jobs:
fail-on-error: false

e2e-tests-build:
name: 'Tests: End-to-end (build job)'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

# build API (using cache; provide image to docker compose)
- name: Build docker image (API/PHP)
uses: docker/build-push-action@v5
with:
file: api/Dockerfile
context: './api'
push: false
load: true
target: api_platform_php_dev
builder: ${{ steps.buildx.outputs.name }}
tags: ecamp/ecamp3-dev-api-php
cache-from: type=gha,scope=api
cache-to: type=gha,scope=api,mode=max
outputs: type=docker,dest=/tmp/ecamp3-dev-api-php.tar

# build caddy (using cache; provide image to docker compose)
- name: Build docker image (Caddy)
uses: docker/build-push-action@v5
with:
file: api/Dockerfile
context: './api'
push: false
load: true
target: api_platform_caddy
builder: ${{ steps.buildx.outputs.name }}
tags: ecamp/ecamp3-dev-api-caddy
cache-from: type=gha,scope=caddy
cache-to: type=gha,scope=caddy,mode=max
outputs: type=docker,dest=/tmp/ecamp3-dev-api-caddy.tar

- uses: actions/upload-artifact@v3
with:
name: e2e-tests-images
path: /tmp/ecamp3-dev-*.tar
name: 'Tests: End-to-end build'
uses: ./.github/workflows/reusable-e2e-tests-build.yml

e2e-tests-run:
name: 'Tests: End-to-end'
runs-on: ubuntu-latest
needs: e2e-tests-build
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
browser:
- chrome
- firefox
- edge
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- run: cp .env.ci .env

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Restore tmp folder
uses: actions/download-artifact@v3
with:
name: e2e-tests-images
path: /tmp

- name: Load images
run: |
docker load --input /tmp/ecamp3-dev-api-php.tar
docker load --input /tmp/ecamp3-dev-api-caddy.tar
docker image ls -a --digests
- name: Restore cache volumes (npm, composer)
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3
with:
path: .cache
key: docker-compose-${{ hashFiles('frontend/package-lock.json', 'print/package-lock.json', 'api/composer.lock') }}-${{ matrix.browser }}
restore-keys: |
docker-compose-
# start necessary containers
- run: docker compose up -d php caddy frontend pdf print browserless database docker-host

- uses: cypress-io/github-action@v5
with:
working-directory: e2e
browser: ${{ matrix.browser }}
wait-on: 'http://localhost:3000, http://localhost:3000/api, http://localhost:3000/print/health'
wait-on-timeout: 300

# store screenshots and videos on GitHub as artifacts, for downloading and debugging in case of problems
- uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-output-${{ matrix.browser }}
path: |
e2e/data/**/*
# print docker container logs (good for debugging; can be disabled again later on)
- run: docker compose logs --tail="all"
if: always()
name: 'Tests: End-to-end run'
needs:
- e2e-tests-build
uses: ./.github/workflows/reusable-e2e-tests-run.yml

coveralls-finished:
name: 'Finish coveralls report'
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: "Tests: End to End to detect flaky tests"

on:
workflow_dispatch:
inputs:
pr_number:
type: number
description: |
Number of times the tests should run
required: true
default: 10
pull_request:
types: [opened, labeled, unlabeled, synchronize]
schedule:
- cron: '42 4 * * *'

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref_name }}
cancel-in-progress: false

jobs:
create-array:
name: 'Create large array for matrix'
if: contains(github.event.pull_request.labels.*.name, 'test-flaky-e2e!') || github.event_name != 'pull_request'
runs-on: ubuntu-latest
outputs:
array: ${{ steps.array.outputs.result }}

steps:
- name: Create large array
uses: actions/github-script@v7
id: array
with:
script: |
function range(start, stop) {
return Array(stop - start)
.fill(start)
.map((value, index) => value + index);
}
return range(0, ${{ inputs.pr_number != null && inputs.pr_number || 10 }})
e2e-tests-build:
name: 'Tests: End-to-end build to detect flaky tests'
needs:
- create-array
uses: ./.github/workflows/reusable-e2e-tests-build.yml

e2e-tests-run:
name: 'Tests: End-to-end run to detect flaky tests'
needs:
- create-array
- e2e-tests-build
uses: ./.github/workflows/reusable-e2e-tests-run.yml
with:
run-identifier: ${{ matrix.array }}
strategy:
fail-fast: false
matrix:
array: ${{ fromJSON(needs.create-array.outputs.array) }}
2 changes: 1 addition & 1 deletion .github/workflows/fast-forward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
if: steps.has_permission.outputs.require-result != 'true'
run: exit 1

- uses: actions/github-script@v6
- uses: actions/github-script@v7
id: current_pr
with:
github-token: ${{ secrets.FAST_FORWARD_TOKEN }}
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/reusable-e2e-tests-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: '[reusable only] e2e tests build'

on:
workflow_call:

jobs:
e2e-tests-build:
name: 'Tests: End-to-end (build job)'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

# build API (using cache; provide image to docker compose)
- name: Build docker image (API/PHP)
uses: docker/build-push-action@v5
with:
file: api/Dockerfile
context: './api'
push: false
load: true
target: api_platform_php_dev
builder: ${{ steps.buildx.outputs.name }}
tags: ecamp/ecamp3-dev-api-php
cache-from: type=gha,scope=api
cache-to: type=gha,scope=api,mode=max
outputs: type=docker,dest=/tmp/ecamp3-dev-api-php.tar

# build caddy (using cache; provide image to docker compose)
- name: Build docker image (Caddy)
uses: docker/build-push-action@v5
with:
file: api/Dockerfile
context: './api'
push: false
load: true
target: api_platform_caddy
builder: ${{ steps.buildx.outputs.name }}
tags: ecamp/ecamp3-dev-api-caddy
cache-from: type=gha,scope=caddy
cache-to: type=gha,scope=caddy,mode=max
outputs: type=docker,dest=/tmp/ecamp3-dev-api-caddy.tar

- uses: actions/upload-artifact@v4
with:
name: e2e-tests-images
path: /tmp/ecamp3-dev-*.tar
71 changes: 71 additions & 0 deletions .github/workflows/reusable-e2e-tests-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: '[reusable only] e2e tests run'

on:
workflow_call:
inputs:
run-identifier:
required: false
type: string

jobs:
e2e-tests-run:
name: 'Tests: End-to-end'
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
browser:
- chrome
- firefox
- edge
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- run: cp .env.ci .env

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Restore tmp folder
uses: actions/download-artifact@v4
with:
name: e2e-tests-images
path: /tmp

- name: Load images
run: |
docker load --input /tmp/ecamp3-dev-api-php.tar
docker load --input /tmp/ecamp3-dev-api-caddy.tar
docker image ls -a --digests
- name: Restore cache volumes (npm, composer)
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3
with:
path: .cache
key: docker-compose-${{ hashFiles('frontend/package-lock.json', 'print/package-lock.json', 'api/composer.lock') }}-${{ matrix.browser }}
restore-keys: |
docker-compose-
# start necessary containers
- run: docker compose up -d php caddy frontend pdf print browserless database docker-host

- uses: cypress-io/github-action@v5
with:
working-directory: e2e
browser: ${{ matrix.browser }}
wait-on: 'http://localhost:3000, http://localhost:3000/api, http://localhost:3000/print/health'
wait-on-timeout: 300

# store screenshots and videos on GitHub as artifacts, for downloading and debugging in case of problems
- uses: actions/upload-artifact@v4
if: always()
with:
name: cypress-output-${{ matrix.browser }}${{ inputs.run-identifier != null && format('-{0}', inputs.run-identifier) }}
path: |
e2e/data/**/*
# print docker container logs (good for debugging; can be disabled again later on)
- run: docker compose logs --tail="all"
if: always()
2 changes: 1 addition & 1 deletion .helm/ecamp3/files/db-backup-restore-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:12.2-slim
FROM debian:12.4-slim

ENV DEBIAN_FRONTEND="noninteractive"
RUN apt-get update && \
Expand Down
4 changes: 2 additions & 2 deletions .ops/aws-setup/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.9"

services:
aws-setup:
image: pulumi/pulumi-nodejs:3.93.0
image: pulumi/pulumi-nodejs:3.99.0
container_name: 'ecamp3-aws-setup'
volumes:
- ../../.prettierrc:/.prettierrc:delegated
Expand All @@ -15,7 +15,7 @@ services:
- AWS_DEFAULT_REGION=eu-west-3

aws-cli:
image: amazon/aws-cli:2.13.35
image: amazon/aws-cli:2.15.2
container_name: 'ecamp3-aws-cli'
volumes:
- ./.aws:/root/.aws:delegated
Expand Down
Loading

0 comments on commit 54953b5

Please sign in to comment.