Skip to content

chore: enable running stress on on self-hosted runner #55

chore: enable running stress on on self-hosted runner

chore: enable running stress on on self-hosted runner #55

Workflow file for this run

name: AppFlowy-Cloud Stress Test
on: [ pull_request, push ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
POSTGRES_HOST: localhost
REDIS_HOST: localhost
MINIO_HOST: localhost
GOTRUE_HOST: localhost
SQLX_OFFLINE: true
RUST_TOOLCHAIN: "1.78"
jobs:
test:
name: Collab Stress Tests
runs-on: self-hosted-appflowy3
steps:
- name: Verify Author is a Member of the Organization
id: check_membership
run: |
ORG_NAME="your-organization" # Replace with your GitHub org name
AUTHOR="${{ github.actor }}"
echo "Checking if $AUTHOR is a member of $ORG_NAME..."
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/orgs/$ORG_NAME/members/$AUTHOR")
if [ "$RESPONSE" == "200" ]; then
echo "✅ $AUTHOR is a member of $ORG_NAME. Proceeding..."
else
echo "⚠️ $AUTHOR is not a member of $ORG_NAME. Skipping CI."
echo "skip_ci=true" >> $GITHUB_ENV
fi
shell: bash
- name: Skip Job
if: env.skip_ci == 'true'
run: |
echo "Skipping the CI job as the author is not a member of the organization."
shell: bash
# Step 3: Checkout Repository
- name: Checkout Repository
if: env.skip_ci != 'true'
uses: actions/checkout@v3
- name: Install Rust Toolchain
if: env.skip_ci != 'true'
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust Dependencies
if: env.skip_ci != 'true'
uses: Swatinem/rust-cache@v2
with:
workspaces: "AppFlowy-Cloud"
- name: Copy and Rename deploy.env to .env
if: env.skip_ci != 'true'
run: cp deploy.env .env
- name: Replace Values in .env
if: env.skip_ci != 'true'
run: |
sed -i '' 's|RUST_LOG=.*|RUST_LOG=trace|' .env
shell: bash
- name: Start Docker Compose Services
if: env.skip_ci != 'true'
run: |
docker compose -f docker-compose-stress-test.yml up -d
docker ps -a
- name: Install Prerequisites
if: env.skip_ci != 'true'
run: |
brew install protobuf
- name: Run Server and Test
if: env.skip_ci != 'true'
run: |
cargo run --package xtask -- --stress-test