Skip to content

Commit b31e02d

Browse files
authored
Merge pull request #99 from Mansi-dass/Mansi-dass-GitHubAction
Another trial for linter Issue
2 parents 00b2eb5 + 64f34af commit b31e02d

File tree

4 files changed

+57
-48
lines changed

4 files changed

+57
-48
lines changed

.github/workflows/interface_test.yml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,28 @@ on:
77

88
jobs:
99
interface_test:
10-
1110
runs-on: ubuntu-latest
1211
defaults:
13-
run:
14-
working-directory: interface
15-
12+
run:
13+
working-directory: interface
1614
strategy:
1715
matrix:
18-
node-version: [12.x, 14.x]
16+
node-version: [16, 18]
1917

2018
steps:
21-
- name: Checkout repository
22-
uses: actions/checkout@v2
19+
- name: Checkout repository
20+
uses: actions/checkout@v3.5.1
2321

24-
- name: Set up Node.js ${{ matrix.node-version }}
25-
uses: actions/setup-node@v1
26-
with:
27-
node-version: ${{ matrix.node-version }}
22+
- name: Set up Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v3.6.0
24+
with:
25+
node-version: ${{ matrix.node-version }}
2826

29-
- name: Install dependencies
30-
run: npm install
27+
- name: Install dependencies
28+
run: npm install
3129

32-
- name: Run the tests and generate coverage report
33-
run: npm test -- --coverage
30+
- name: Run the tests and generate coverage report
31+
run: npm test -- --coverage
3432

35-
- name: Upload coverage to Codecov
36-
uses: codecov/codecov-action@v1
33+
- name: Upload coverage to Codecov
34+
uses: codecov/codecov-action@v3.1.2

.github/workflows/linter.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ on:
77

88
jobs:
99
lint:
10-
1110
runs-on: ubuntu-latest
12-
1311
steps:
14-
- name: Checkout Code
15-
uses: actions/checkout@v2
16-
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
ref: ${{ github.head_ref }}
17+
repository: ${{ github.event.pull_request.head.repo.full_name }}
18+
1719
- name: Lint Code Base
18-
uses: docker://github/super-linter:v3
20+
uses: github/super-linter@v4
1921
env:
20-
PYTHON_PYLINT_CONFIG_FILE: .pylintrc
2122
VALIDATE_ALL_CODEBASE: false
22-
VALIDATE_PYTHON_PYLINT: true
23-
VALIDATE_JAVASCRIPT_ES: true
24-
DEFAULT_BRANCH: master
23+
DEFAULT_BRANCH: "master"
24+
PYTHON_PYLINT_CONFIG_FILE: .pylintrc
2525
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/py_tests.yml

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,42 @@ on:
1010

1111
jobs:
1212
py_test:
13-
1413
runs-on: ubuntu-latest
1514
strategy:
1615
matrix:
16+
ports: ["9000:5432", "8000:8000", "5001:5000", "6001:6000", "8008:8075", "3001:3000"]
1717
code: [ app, client]
1818
include:
19-
- code: app
20-
path: ./yaba_test/test_yaba.py
21-
- code: client
22-
path: ./yaba_client_test/test_yaba_client.py
19+
- code: app
20+
path: ./yaba_test/test_yaba.py
21+
- code: client
22+
path: ./yaba_client_test/test_yaba_client.py
2323

2424
steps:
2525
- name: Checkout Code
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v3
2727

28-
- name: Set up Python 3.7
29-
uses: actions/setup-python@v2
28+
- name: Set up Python 3.10
29+
uses: actions/setup-python@v3
3030
with:
31-
python-version: 3.7
31+
python-version: '3.10'
32+
cache: 'pip'
3233

3334
- name: Install dependencies
3435
run: |
3536
pip install --upgrade pip
36-
pip install pytest
37-
pip install pytest-cov
37+
pip install pytest pytest-cov
3838
pip install docker-compose
39-
39+
4040
- name: Set-up the project
4141
run: |
42-
docker-compose up -d postgres
43-
docker-compose run --rm bety initialize
44-
docker-compose up -d
45-
docker ps -a
46-
docker logs betydb-yaba_yaba_api_1
42+
docker-compose -p bety up -d postgres
43+
docker run --rm --network bety_bety pecan/db
4744
4845
- name: Test with pytest and generate coverage report
4946
run: |
50-
sleep 20
51-
pytest --cov= ${{ matrix.path }} --cov-report=xml
52-
47+
chmod +x wait-for-server.sh
48+
bash ./wait-for-server.sh ${{ matrix.ports }} pytest --cov= ${{ matrix.path }} --cov-report=xml
49+
5350
- name: Upload coverage to Codecov
54-
uses: codecov/codecov-action@v1
51+
uses: codecov/codecov-action@v3

wait-for-server.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
host="$1"
6+
shift
7+
cmd="$*"
8+
9+
until curl --silent --output /dev/null --fail "http://$host"; do
10+
echo "Waiting for server..."
11+
sleep 5
12+
done
13+
14+
exec $cmd

0 commit comments

Comments
 (0)