Skip to content

Commit

Permalink
Merge pull request #26 from nanocom2024/githubactions-auto-test
Browse files Browse the repository at this point in the history
GitHub ActionsによるServerの自動動作確認
  • Loading branch information
k22036 committed Aug 20, 2024
2 parents 6fdbd88 + 57ff239 commit f68666d
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/auto-test.yml
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

0 comments on commit f68666d

Please sign in to comment.