Skip to content

Fixed reference to secrets #116

Fixed reference to secrets

Fixed reference to secrets #116

Workflow file for this run

name: test
on:
push:
branches:
- master
pull_request:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: npm
- name: Install Cypress dependencies
run: npm ci
- name: Ensure files follow code style
run: npm run lint
test:
name: Test Docker image
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
dockerfile:
- apache
- apache-php8.2
- nginx
- nginx-php8.2
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: npm
- name: Install Cypress dependencies
run: npm ci
- name: Build Docker image
id: build
run: docker build -f ${{ matrix.dockerfile }}.dockerfile -t baikal-image .
- name: Start Baikal container
run: docker run --rm -dp 80:80 --name ${{ matrix.dockerfile }} baikal-image
- name: Run Cypress tests
run: npm run test
- name: Stop Baikal container
run: docker stop ${{ matrix.dockerfile }}
- name: Build and run MailSlurper
run: |
docker build -q 'https://github.com/mailslurper/mailslurper.git#release-1.15.0' -t mailslurper
docker run --rm --detach --name mailslurper -p 8085:8085 -v ${{ github.workspace }}/cypress/fixtures/mailslurper-config.json:/config.json:ro mailslurper
- name: Start Baikal container with MSMTP configuration
env:
MSMTPRC: |
account default
host mailslurper
port 2500
from baikal@example.com
run: |
docker run --rm --detach -p 80:80 -e MSMTPRC="$MSMTPRC" --link mailslurper --name baikal baikal-image
docker cp ${{ github.workspace }}/cypress/fixtures/mail-test.php baikal:/var/www/baikal/html/
- name: Run Cypress tests incl. MSMTP
run: CYPRESS_MSMTP_ENABLED=TRUE npm run test
- name: Archive test results
if: always()
uses: actions/upload-artifact@v4
with:
name: cypress-results-${{ matrix.dockerfile }}
path: cypress/screenshots