Skip to content

Commit

Permalink
fix(ci): add the plugin directory
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas TESSON <lucastesson@protonmail.com>
  • Loading branch information
pandatix committed Jan 16, 2025
1 parent 7b0ac94 commit ac1eb6f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 68 deletions.
68 changes: 0 additions & 68 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,74 +10,6 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
tests:
runs-on: ubuntu-latest
services:
ctfd:
image: ctfd/ctfd:3.7.5@sha256:7f456b23727286c9df2b58e0b7398cc0196e2b74e4c1c5b3cda7a5b71034637d
ports:
- 8000:8000
options: --mount type=bind,source=${{ github.workspace }}/ctfd-chall-manager,target=/opt/CTFd/CTFd/plugins/ctfd-chall-manager
env:
PLUGIN_SETTINGS_CM_API_URL: http://chall-manager:8080/api/v1
PLUGIN_SETTINGS_CM_MANA_TOTAL: 10

chall-manager:
image: ctferio/chall-manager:v0.2.0@sha256:088b8871a55dff8d215ab024c3e1dbfb4dcecd90432abb49fdf1a3c6a6bf8532
ports:
- 8080:8080
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Checking out CTFd-Chall-Manager plugin
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: 'ctfer-io/ctfd-chall-manager'
ref: '64d7ca041ace664d11d68e9910e82d3b2702929e'
path: ctfd-chall-manager

- name: Setup Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version-file: 'go.mod'

- name: Cache go modules
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-

- name: Wait for CTFd server
run: |
max_attempts=60
base_url="http://localhost:8000"
for ((i=0; i<$max_attempts; i++)); do
if curl --head --fail --silent --show-error "$base_url" >/dev/null; then
echo "Server is up and running!"
break
else
echo "Waiting for the server to respond... (attempt $((i+1)))"
sleep 5
fi
done
if [ $i -eq $max_attempts ]; then
echo "Server did not respond within the allotted time. Exiting..."
exit 1
fi
- name: Run go tests
run: make tests
env:
CTFD_URL: http://localhost:8000

- name: Upload coverage to Coveralls
if: ${{ matrix.update-coverage }}
uses: shogo82148/actions-goveralls@785c9d68212c91196d3994652647f8721918ba11 # v1.9.0
with:
path-to-profile: functional.out

go-lint:
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions ctfd-chall-manager/DO_NOT_DELETE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Do not delete this file, used for ci.yaml workflow

0 comments on commit ac1eb6f

Please sign in to comment.