Skip to content

Commit 342c981

Browse files
authored
test(github-actions): migrate tests to GitHub Actions (#112)
test(github-actions): migrate tests to GitHub Actions Migrate PubNub SDK test suite from Travis to GitHub Actions.
1 parent 5da4f5d commit 342c981

File tree

8 files changed

+119
-185
lines changed

8 files changed

+119
-185
lines changed

.github/workflows/commands-handler.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@ on:
44
issue_comment:
55
types: [created]
66

7+
78
jobs:
89
process:
910
name: Process command
1011
if: ${{ github.event.issue.pull_request && endsWith(github.repository, '-private') != true && startsWith(github.event.comment.body, '@client-engineering-bot ') }}
1112
runs-on: ubuntu-latest
1213
steps:
1314
- name: Checkout repository
14-
uses: actions/checkout@v2
15+
uses: actions/checkout@v3
16+
with:
17+
token: ${{ secrets.GH_TOKEN }}
1518
- name: Checkout release actions
16-
uses: actions/checkout@v2
19+
uses: actions/checkout@v3
1720
with:
1821
repository: pubnub/client-engineering-deployment-tools
1922
ref: v1

.github/workflows/release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
release: ${{ steps.check.outputs.ready }}
1616
steps:
1717
- name: Checkout actions
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v3
1919
with:
2020
repository: pubnub/client-engineering-deployment-tools
2121
ref: v1
@@ -33,12 +33,12 @@ jobs:
3333
if: ${{ needs.check-release.outputs.release == 'true' }}
3434
steps:
3535
- name: Checkout repository
36-
uses: actions/checkout@v2
36+
uses: actions/checkout@v3
3737
with:
3838
# This should be the same as the one specified for on.pull_request.branches
3939
ref: master
4040
- name: Checkout actions
41-
uses: actions/checkout@v2
41+
uses: actions/checkout@v3
4242
with:
4343
repository: pubnub/client-engineering-deployment-tools
4444
ref: v1
@@ -56,3 +56,8 @@ jobs:
5656
token: ${{ secrets.GH_TOKEN }}
5757
jira-api-key: ${{ secrets.JIRA_API_KEY }}
5858
last-service: true
59+
- name: Upload test reports
60+
uses: ./.github/.release/actions/actions/test-reports/upload
61+
with:
62+
token: ${{ secrets.GH_TOKEN }}
63+
acceptance-tests-workflow: Tests

.github/workflows/run-tests.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
7+
8+
jobs:
9+
tests:
10+
name: Integration and Unit tests
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
with:
16+
token: ${{ secrets.GH_TOKEN }}
17+
- name: Setup Python 3.7
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: '3.7.13'
21+
- name: Build and run tests for Python 3.7
22+
run: |
23+
./scripts/install.sh
24+
python scripts/run-tests.py
25+
- name: Setup Python 3.8
26+
uses: actions/setup-python@v4
27+
with:
28+
python-version: '3.8.13'
29+
- name: Build and run tests for Python 3.8
30+
run: |
31+
./scripts/install.sh
32+
python scripts/run-tests.py
33+
- name: Setup Python 3.9
34+
uses: actions/setup-python@v4
35+
with:
36+
python-version: '3.9.13'
37+
- name: Build and run tests for Python 3.9
38+
run: |
39+
./scripts/install.sh
40+
python scripts/run-tests.py
41+
- name: Setup Python 3.10
42+
uses: actions/setup-python@v4
43+
with:
44+
python-version: '3.10-dev'
45+
- name: Build and run tests for Python 3.10
46+
run: |
47+
./scripts/install.sh
48+
python scripts/run-tests.py
49+
acceptance:
50+
name: Acceptance tests
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout project
54+
uses: actions/checkout@v3
55+
- name: Checkout mock-server action
56+
uses: actions/checkout@v3
57+
with:
58+
repository: pubnub/client-engineering-deployment-tools
59+
ref: v1
60+
token: ${{ secrets.GH_TOKEN }}
61+
path: .github/.release/actions
62+
- name: Setup Python 3.9
63+
uses: actions/setup-python@v4
64+
with:
65+
python-version: '3.9.13'
66+
- name: Run mock server action
67+
uses: ./.github/.release/actions/actions/mock-server
68+
with:
69+
token: ${{ secrets.GH_TOKEN }}
70+
- name: Install Python dependencies and run acceptance tests
71+
run: |
72+
cp sdk-specifications/features/access/authorization-failure-reporting.feature tests/acceptance/pam
73+
cp sdk-specifications/features/access/grant-token.feature tests/acceptance/pam
74+
cp sdk-specifications/features/access/revoke-token.feature tests/acceptance/pam
75+
76+
sudo pip3 install -r requirements-dev.txt
77+
behave --junit tests/acceptance/pam
78+
- name: Expose acceptance tests reports
79+
uses: actions/upload-artifact@v3
80+
if: always()
81+
with:
82+
name: acceptance-test-reports
83+
path: ./reports
84+
retention-days: 7
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Validations
2+
3+
on: [push]
4+
5+
jobs:
6+
validators:
7+
name: "Validate .pubnub.yml"
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout project
11+
uses: actions/checkout@v3
12+
- name: Checkout validator action
13+
uses: actions/checkout@v3
14+
with:
15+
repository: pubnub/client-engineering-deployment-tools
16+
ref: v1
17+
token: ${{ secrets.GH_TOKEN }}
18+
path: .github/.release/actions
19+
- name: "Run '.pubnub.yml' file validation"
20+
uses: ./.github/.release/actions/actions/validators/pubnub-yml
21+
with:
22+
token: ${{ secrets.GH_TOKEN }}

.github/workflows/run_acceptance_tests.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/validate-pubnub-yml.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/validate-yml.js

Lines changed: 0 additions & 94 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)