chore(deps): bump actions/upload-artifact from 4.3.6 to 4.4.0 #177
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
env: | |
NAME: ctfer | |
PASSWORD: ctfer | |
services: | |
chall-manager: | |
image: ctferio/chall-manager:dev | |
ports: | |
- 9090:9090 | |
- 8081:8081 | |
env: | |
CI: true | |
credentials: | |
username: ${{ secrets.docker_username }} | |
password: ${{ secrets.docker_password }} | |
mariadb: | |
image: mariadb:10.7.8 | |
ports: | |
- 3306:3306 | |
env: | |
MYSQL_ROOT_PASSWORD: ctfer | |
ctfd: | |
image: ctfd/ctfd:3.7.3@sha256:90470e1fe0f93028ce6ac197b8942916ee157d4b5d33c8266c5bec7662e55ac3 | |
ports: | |
- 8000:8000 | |
options: --mount type=bind,source=${{ github.workspace }},target=/opt/CTFd/CTFd/plugins/ctfd-chall-manager | |
env: | |
DATABASE_URL: mysql+pymysql://root:ctfer@mariadb/ctfd | |
LOG_LEVEL: DEBUG | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- 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: Wait for Chall-Manager server | |
run: | | |
max_attempts=60 | |
base_url="http://localhost:9090/api/v1/challenge" | |
for ((i=0; i<$max_attempts; i++)); do | |
if curl --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@f76c764b07af9c6292de3f75009876e26c77bb1f # v1.2.1 | |
with: | |
url: 'http://ctfd:8000' | |
appearance_name: CTFer.io | |
appearance_description: CTFer.io plugin tests | |
mode: teams | |
admin_name: ${{ env.NAME }} | |
admin_email: [email protected] | |
admin_password: ${{ env.PASSWORD }} | |
- name: Setup Go | |
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 | |
- name: Generate token and store it for GH Actions | |
run: |- | |
cd hack/token | |
go run main.go | |
env: | |
CTFD_URL: http://localhost:8000 | |
CTFD_NAME: ${{ env.NAME }} | |
CTFD_PASSWORD: ${{ env.PASSWORD }} | |
- name: Install pulumi | |
uses: pulumi/actions@ccd8e6d0d14d7ead561274adf8837a016b9c4f4e # 5.4.0 | |
- name: Additionnal configuration for CTFd (users and teams) | |
run: |- | |
cd hack/config | |
pulumi login --local | |
pulumi stack init tmp | |
pulumi up --yes --stack tmp | |
env: | |
PULUMI_CONFIG_PASSPHRASE: "" | |
CTFD_URL: http://localhost:8000 | |
# go build -o monbinaire mon/path/vers/main.go => go build -o main main.go entre le cd et le zip | |
- name: Generate demo-deploy.zip for tests | |
run: |- | |
cd hack/deploy | |
zip ${{ github.workspace }}/demo-deploy.zip main | |
zip ${{ github.workspace }}/demo-deploy.zip Pulumi.yaml | |
env: | |
CGO_ENABLED: 0 | |
GOPRIVATE: github.com/ctfer-io/chall-manager # remove when chall-manager will be released | |
- name: tests with cypress | |
uses: cypress-io/github-action@df7484c5ba85def7eef30db301afa688187bc378 # v6.7.2 | |
env: | |
CYPRESS_CTFD_NAME: ${{ env.NAME }} | |
CYPRESS_CTFD_PASSWORD: ${{ env.PASSWORD }} | |
CYPRESS_CTFD_URL: "http://localhost:8000" | |
CYPRESS_SCENARIO_PATH: "${{ github.workspace }}/demo-deploy.zip" | |
CYPRESS_PLUGIN_SETTINGS_CM_API_URL: "http://chall-manager:9090/api/v1" | |
CYPRESS_PLUGIN_SETTINGS_CM_MANA_TOTAL: "10" | |
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # 4.4.0 | |
if: failure() | |
with: | |
name: cypress-screenshots | |
path: cypress/screenshots | |
if-no-files-found: ignore |