-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from nanocom2024/githubactions-auto-test
GitHub ActionsによるServerの自動動作確認
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Auto Test nanoRelation Server | ||
|
||
on: [pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
auto_test: | ||
name: Auto Test nanoRelation Server | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: install screen | ||
run: sudo apt-get install -y screen | ||
|
||
- name: setup python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: '3.11.5' | ||
|
||
- name: Install dependencies | ||
run: | | ||
cd server | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Start MongoDB | ||
uses: supercharge/[email protected] | ||
with: | ||
mongodb-version: '6.0' | ||
mongodb-replica-set: test-rs | ||
|
||
- name: create json | ||
id: create-json | ||
uses: jsdaniell/[email protected] | ||
with: | ||
name: "nanorelation-firebase-adminsdk.json" | ||
json: ${{ secrets.FIREBASE_ADMINSDK }} | ||
dir: "server/" | ||
|
||
- name: Init env | ||
run: echo "${{ secrets.DOT_ENV }}" > server/.env | ||
|
||
- name: Start Server | ||
run: | | ||
screen -d -m -S server bash -c "make server-start"; sleep 3 | ||
- name: Run tests | ||
run: | | ||
cd server | ||
make run-test | ||
- name: Stop Server | ||
run: | | ||
screen -S server -X quit |