Skip to content

Commit e164cbe

Browse files
authored
Merge pull request #60 from iai-group/demo
SimLab demo
2 parents e563f0e + a0e1481 commit e164cbe

File tree

166 files changed

+9955
-1126
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+9955
-1126
lines changed

.github/actions/build_test/action.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ inputs:
88
test_dir:
99
description: "The directory containing the Python tests."
1010
required: true
11-
11+
artifact_prefix:
12+
description: "Prefix for the artifact names."
13+
required: true
14+
default: "coverage"
15+
1216
runs:
1317
using: "composite"
1418
steps:
@@ -44,7 +48,7 @@ runs:
4448
4549
- name: PyTest with code coverage
4650
shell: bash
47-
continue-on-error: true
51+
# continue-on-error: true
4852
run: |
4953
pytest --junitxml pytest.xml --cov=${{ inputs.code_dir }} --cov-report=term-missing --cov-report=xml --cov-branch ${{ inputs.test_dir }} | tee pytest-coverage.txt
5054
@@ -56,22 +60,22 @@ runs:
5660
5761
- name: Upload Coverage Results txt
5862
if: always()
59-
uses: actions/upload-artifact@v3
63+
uses: actions/upload-artifact@v4
6064
with:
61-
name: coverage-results-txt
65+
name: ${{ inputs.artifact_prefix }}-coverage-results-txt
6266
path: ./pytest-coverage.txt
6367

6468
- name: Upload Coverage Results xml
6569
if: always()
66-
uses: actions/upload-artifact@v3
70+
uses: actions/upload-artifact@v4
6771
with:
68-
name: coverage-results-xml
72+
name: ${{ inputs.artifact_prefix }}-coverage-results-xml
6973
path: ./coverage.xml
7074

7175
- name: Upload Unit Test Results
7276
if: always()
73-
uses: actions/upload-artifact@v3
77+
uses: actions/upload-artifact@v4
7478
with:
75-
name: unit-test-py39
79+
name: ${{ inputs.artifact_prefix }}-unit-test-py39
7680
path: ./pytest.xml
7781

.github/actions/coverage_badge/action.yaml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ inputs:
1414
runs:
1515
using: "composite"
1616
steps:
17-
- uses: actions/checkout@v3
18-
- name: Download Artifacts
19-
uses: actions/download-artifact@v3
20-
with:
21-
path: artifacts
22-
2317
- name: Read Coverage and Generate Badge
2418
shell: bash
2519
env:
@@ -65,12 +59,3 @@ runs:
6559
# Add new badge at the top
6660
echo "![${BADGE_TITLE}](${BADGE_URL})" | cat - README.md > temp && mv temp README.md
6761
fi
68-
69-
- name: Commit Updated README.md
70-
shell: bash
71-
run: |
72-
git config --local user.name "github-actions[bot]"
73-
git config --local user.email "github-actions[bot]@users.noreply.github.com"
74-
git add README.md
75-
git commit -m "Update coverage badge in README"
76-
git push

.github/workflows/cd-simlab.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy to GCP VM
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Deploy to GCP VM
17+
uses: appleboy/ssh-action@v0.1.11
18+
with:
19+
host: ${{ secrets.GCP_VM_HOST }}
20+
username: ${{ secrets.GCP_VM_USER }}
21+
key: ${{ secrets.SSH_PRIVATE_KEY }}
22+
port: 22
23+
script: |
24+
# Navigate to the application directory
25+
cd /home/sharath/simlab
26+
27+
# Pull the latest code
28+
git reset --hard
29+
git pull origin master
30+
31+
# Build or restart your application (e.g., Docker, Node.js, etc.)
32+
docker compose down
33+
docker compose up -d --build

.github/workflows/ci-backend.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151

5252
steps:
5353
- name: Download Artifacts
54-
uses: actions/download-artifact@v3
54+
uses: actions/download-artifact@v4
5555
with:
5656
path: artifacts
5757

.github/workflows/ci-merge.yaml

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,7 @@ jobs:
4747
with:
4848
code_dir: "webapp/backend"
4949
test_dir: "tests/backend"
50-
51-
- name: Update coverage badge in README
52-
uses: ./.github/actions/coverage_badge
53-
with:
54-
coverage_file: "artifacts/coverage-results-txt/pytest-coverage.txt"
55-
badge_title: "backend"
50+
artifact_prefix: "backend"
5651

5752
build-and-test-simlab:
5853
name: "Build and Test SimLab"
@@ -69,9 +64,47 @@ jobs:
6964
with:
7065
code_dir: "simlab"
7166
test_dir: "tests/simlab"
67+
artifact_prefix: "simlab"
68+
69+
update-coverage-badges:
70+
name: "Update Coverage Badges in README"
71+
runs-on: ubuntu-latest
72+
needs: [build-and-test-backend, build-and-test-simlab]
73+
timeout-minutes: 5
74+
75+
steps:
76+
- name: Checkout Repository
77+
uses: actions/checkout@v3
7278

73-
- name: Update coverage badge in README
79+
- name: Download Backend Coverage Results
80+
uses: actions/download-artifact@v4
81+
with:
82+
name: backend-coverage-results-txt
83+
path: artifacts/backend_coverage
84+
85+
- name: Download SimLab Coverage Results
86+
uses: actions/download-artifact@v4
87+
with:
88+
name: simlab-coverage-results-txt
89+
path: artifacts/simlab_coverage
90+
91+
- name: Update Coverage Backend Badge
7492
uses: ./.github/actions/coverage_badge
7593
with:
76-
coverage_file: "artifacts/coverage-results-txt/pytest-coverage.txt"
94+
coverage_file: "artifacts/backend_coverage/pytest-coverage.txt"
95+
badge_title: "backend"
96+
97+
- name: Update Coverage SimLab Badge
98+
uses: ./.github/actions/coverage_badge
99+
with:
100+
coverage_file: "artifacts/simlab_coverage/pytest-coverage.txt"
77101
badge_title: "simlab"
102+
103+
- name: Commit Updated README.md
104+
shell: bash
105+
run: |
106+
git config --local user.name "github-actions[bot]"
107+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
108+
git add README.md
109+
git commit -m "Update coverage badge in README"
110+
git push

.github/workflows/ci-simlab.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
uses: actions/checkout@v3
5555

5656
- name: Download Artifacts
57-
uses: actions/download-artifact@v3
57+
uses: actions/download-artifact@v4
5858
with:
5959
path: artifacts
6060

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ dmypy.json
128128
# Pyre type checker
129129
.pyre/
130130

131-
132-
dialoguekit/
133131
nginx/ssl/
134132
data/mongo/*
133+
data/datasets/*
134+
data/simlab/configs/*
135135

136136
# Ignore all .DS_Store files
137137
**/.DS_Store

0 commit comments

Comments
 (0)