Skip to content

Add ctfd_challenge.attribution after CTFd update to v3.7.5 #586

Add ctfd_challenge.attribution after CTFd update to v3.7.5

Add ctfd_challenge.attribution after CTFd update to v3.7.5 #586

Workflow file for this run

name: CI
on: [push, pull_request]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
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
env:
NAME: ctfer
PASSWORD: password
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- 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: Setup CTFd
uses: ctfer-io/ctfd-setup@4f039f18e2e78cb4eeb7a2c89e0c38a5a6afa392 # v1.5.2
with:
url: 'http://ctfd:8000'
appearance_name: TFP-CTFd
appearance_description: Terraform Provider CTFd.
mode: teams
admin_name: ${{ env.NAME }}
admin_email: [email protected]
admin_password: ${{ env.PASSWORD }}
- name: Generate token
run: go run cmd/token/main.go
env:
CTFD_URL: http://localhost:8000
CTFD_NAME: ${{ env.NAME }}
CTFD_PASSWORD: ${{ env.PASSWORD }}
- name: Run go acceptance tests
run: make test-acc
env:
CTFD_URL: http://localhost:8000
- name: Upload coverage to Coveralls
uses: shogo82148/actions-goveralls@785c9d68212c91196d3994652647f8721918ba11 # v1.9.0
with:
path-to-profile: cov.out
go-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version-file: go.mod
- name: go-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1