mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Refactor API testing workflow to include Docker startup and MongoDB user setup steps
This commit is contained in:
parent
7c7e60c22f
commit
9da7005a66
1 changed files with 16 additions and 6 deletions
22
.github/workflows/api-testing.yml
vendored
22
.github/workflows/api-testing.yml
vendored
|
@ -4,30 +4,40 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
workflow_dispatch: # Allows manual triggering of the workflow
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Step 1: Checkout the code
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# Step 2: Set up Python
|
|
||||||
- name: Set up Python 3.12
|
- name: Set up Python 3.12
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.12"
|
||||||
|
|
||||||
# Step 3: Install dependencies
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
|
|
||||||
# Step 4: Run API tests
|
- name: App Startup with Docker
|
||||||
|
run: |
|
||||||
|
docker compose up -d
|
||||||
|
|
||||||
|
- name: Add test user to MongoDB
|
||||||
|
run: |
|
||||||
|
docker exec wekan-db mongosh wekan --eval '
|
||||||
|
db.users.insertOne({
|
||||||
|
username: "omriza5",
|
||||||
|
password: "123456",
|
||||||
|
email: "omriza5@gmail.com",
|
||||||
|
isAdmin: false
|
||||||
|
})
|
||||||
|
'
|
||||||
|
|
||||||
- name: Run API tests
|
- name: Run API tests
|
||||||
env:
|
env:
|
||||||
BASE_URL: ${{ secrets.WEKAN_URL }} # Example: Pass API base URL as a secret
|
BASE_URL: ${{ secrets.WEKAN_URL }} # Example: Pass API base URL as a secret
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue