Skip to content

Merge pull request #2 from JoeyInvictus/upgrade-chall-manager-0.9.0 #12

Merge pull request #2 from JoeyInvictus/upgrade-chall-manager-0.9.0

Merge pull request #2 from JoeyInvictus/upgrade-chall-manager-0.9.0 #12

Workflow file for this run

name: E2E testing (front)
on:
push:
paths-ignore:
- 'webdocs/**'
- 'res/**'
pull_request:
permissions:
contents: read
jobs:
tests:
runs-on: ubuntu-latest
env:
NAME: ctfer
PASSWORD: ctfer
services:
chall-manager:
image: ctferio/chall-manager:v0.6.0@sha256:4d0a0379a3c12b2203500a7852856ef7202c7c54d58207fb88d4b8919d5f6add
ports:
- 8080:8080
env:
OCI_INSECURE: true
registry:
image: registry:2
ports:
- 5000:5000
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Get GitHub Actions network name
id: get_network
run: |
# Find the network ID (GitHub Actions creates one automatically)
NETWORK_NAME=$(docker network ls --filter name=github_network_* --format "{{.Name}}")
echo "network_name=$NETWORK_NAME" >> $GITHUB_OUTPUT
- name: Start CTFd after checkout
run: |
docker run -d -p 8000:8000 \
--name ctfd \
--network ${{ steps.get_network.outputs.network_name }} \
-e LOG_LEVEL=DEBUG \
-e PLUGIN_SETTINGS_CM_API_URL=http://chall-manager:8080 \
-e PLUGIN_SETTINGS_CM_MANA_TOTAL=15 \
-v ${{ github.workspace }}:/opt/CTFd/CTFd/plugins/ctfd_chall_manager \
ctfd/ctfd:3.8.1@sha256:0de331947204628900fb68e01478dfd6f209aadf4eac269a2be08ee92af8ef0d
- name: Setup basic testing env
uses: ./.github/workflows/setup-testing
with:
ctfd_mode: teams
ctfd_user: ${{ env.NAME }}
ctfd_pass: ${{ env.PASSWORD }}
- name: tests with cypress
uses: cypress-io/github-action@2ad32e649e4db26c07674ebae31a297601dbcbaf # v6.10.8
env:
CYPRESS_CTFD_NAME: ${{ env.NAME }}
CYPRESS_CTFD_PASSWORD: ${{ env.PASSWORD }}
CYPRESS_CTFD_URL: "http://localhost:8000"
CYPRESS_SCENARIO: "registry:5000/examples/deploy:latest"
CYPRESS_PLUGIN_SETTINGS_CM_API_URL: "http://chall-manager:8080"
CYPRESS_PLUGIN_SETTINGS_CM_MANA_TOTAL: "10"
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # 6.0.0
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
if-no-files-found: ignore
- name: Export Logs and clean CTFd
if: always()
run : |
docker logs ctfd
docker stop ctfd
docker rm ctfd