Skip to content

Commit 5422aab

Browse files
authored
Use yml validation action (#122)
test(validate): use yml validation action Use specific GitHub action for `.pubnub.yml` validation. test(github-actions): move to GitHub Actions Move tests execution to GitHub Actions instead of Travis.
1 parent ad6185d commit 5422aab

File tree

16 files changed

+285
-275
lines changed

16 files changed

+285
-275
lines changed

.github/workflows/acceptance-tests.yaml

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

.github/workflows/commands-handler.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
process:
99
name: Process command
10-
if: ${{ github.event.issue.pull_request && endsWith(github.repository, '-private') != true && startsWith(github.event.comment.body, '@client-engineering-bot ') }}
10+
if: ${{ github.event.issue.pull_request && endsWith(github.repository, '-private') != true && startsWith(github.event.comment.body, format('@{0} ', secrets.CLEN_BOT)) }}
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout repository
@@ -25,5 +25,5 @@ jobs:
2525
uses: ./.github/.release/actions/actions/commands
2626
with:
2727
token: ${{ secrets.GH_TOKEN }}
28-
listener: client-engineering-bot
28+
listener: ${{ secrets.CLEN_BOT }}
2929
jira-api-key: ${{ secrets.JIRA_API_KEY }}

.github/workflows/run-tests.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
defaults:
10+
run:
11+
shell: bash
12+
13+
jobs:
14+
tests:
15+
name: Integration and Unit tests
16+
runs-on: macos-12
17+
strategy:
18+
matrix:
19+
environment: [iOS, tvOS, macOS]
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v3
23+
with:
24+
token: ${{ secrets.GH_TOKEN }}
25+
- name: Setup Ruby 2.6.6
26+
uses: ruby/setup-ruby@v1
27+
with:
28+
ruby-version: 2.6.6
29+
bundler-cache: true
30+
- name: Cache installed Pods
31+
uses: actions/cache@v3
32+
with:
33+
path: Pods
34+
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-pods-
37+
- name: Cache Swift Package Manager
38+
uses: actions/cache@v3
39+
with:
40+
path: |
41+
.build
42+
~/Library/Developer/Xcode/DerivedData/**/SourcePackages/checkouts
43+
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
44+
restore-keys: |
45+
${{ runner.os }}-spm-
46+
- name: Pre-load simulators list
47+
if: ${{ matrix.environment != 'macOS' }}
48+
run: xcrun simctl list -j
49+
- name: Run ${{ matrix.environment }} unit tests
50+
run: bundle exec fastlane test --env $(echo ${{ matrix.environment }} | tr '[:upper:]' '[:lower:]')
51+
acceptance-tests:
52+
name: Acceptance tests
53+
runs-on: macos-12
54+
steps:
55+
- name: Checkout repository
56+
uses: actions/checkout@v3
57+
- name: Setup Ruby 2.6.6
58+
uses: ruby/setup-ruby@v1
59+
with:
60+
ruby-version: 2.6.6
61+
bundler-cache: true
62+
- name: Cache installed Pods
63+
uses: actions/cache@v3
64+
with:
65+
path: Pods
66+
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
67+
restore-keys: |
68+
${{ runner.os }}-pods-
69+
- name: Cache Swift Package Manager
70+
uses: actions/cache@v3
71+
with:
72+
path: |
73+
.build
74+
~/Library/Developer/Xcode/DerivedData/**/SourcePackages/checkouts
75+
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
76+
restore-keys: |
77+
${{ runner.os }}-spm-
78+
- name: Checkout mock-server action
79+
uses: actions/checkout@v3
80+
with:
81+
repository: pubnub/client-engineering-deployment-tools
82+
ref: v1
83+
token: ${{ secrets.GH_TOKEN }}
84+
path: .github/.release/actions
85+
- name: Run mock server action
86+
uses: ./.github/.release/actions/actions/mock-server
87+
with:
88+
token: ${{ secrets.GH_TOKEN }}
89+
features-path: Tests/PubNubContractTest/Features/
90+
- name: Preapre Xcode environment
91+
run: |
92+
bundle install --jobs=3 --retry=3
93+
bundle exec pod install
94+
- name: Run stable acceptance tests
95+
run: |
96+
bundle exec fastlane contract_test --env contract
97+
mv Results/CucumberishTestResults-PubNubContractTests.json Results/main.json
98+
- name: Run beta acceptance tests
99+
run: |
100+
bundle exec fastlane contract_test --env contract-beta && FASTLANE_EXITCODE="${PIPESTATUS[0]}"
101+
mv Results/CucumberishTestResults-PubNubContractTestsBeta.json Results/beta.json
102+
- name: Upload acceptance tests reports
103+
uses: actions/upload-artifact@v3
104+
with:
105+
name: acceptance-test-reports
106+
path: Results/*.json
107+
retention-days: 7
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Validations
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
defaults:
10+
run:
11+
shell: bash
12+
13+
jobs:
14+
repository-validators:
15+
name: "Validate .pubnub.yml"
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout project
19+
uses: actions/checkout@v3
20+
- name: Checkout validator action
21+
uses: actions/checkout@v3
22+
with:
23+
repository: pubnub/client-engineering-deployment-tools
24+
ref: v1
25+
token: ${{ secrets.GH_TOKEN }}
26+
path: .github/.release/actions
27+
- name: "Run '.pubnub.yml' file validation"
28+
uses: ./.github/.release/actions/actions/validators/pubnub-yml
29+
with:
30+
token: ${{ secrets.GH_TOKEN }}
31+
package-managers-validation:
32+
name: Validate package managers
33+
runs-on: macos-12
34+
strategy:
35+
matrix:
36+
managers: [CocoaPods, Swift Package Manager]
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v3
40+
with:
41+
token: ${{ secrets.GH_TOKEN }}
42+
- name: Setup Ruby 2.6.6
43+
uses: ruby/setup-ruby@v1
44+
with:
45+
ruby-version: 2.6.6
46+
bundler-cache: true
47+
- name: Cache Swift Package Manager
48+
uses: actions/cache@v3
49+
with:
50+
path: |
51+
.build
52+
~/Library/Developer/Xcode/DerivedData/**/SourcePackages/checkouts
53+
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
54+
restore-keys: |
55+
${{ runner.os }}-spm-
56+
- name: ${{ matrix.managers }} validation
57+
run: bundle exec fastlane lint_$(echo ${{ matrix.managers }} | tr '[:upper:]' '[:lower:]' | tr ' ' '_')
58+
demo-app-validation:
59+
name: Validate demo application
60+
runs-on: macos-12
61+
steps:
62+
- name: Checkout repository
63+
uses: actions/checkout@v3
64+
with:
65+
token: ${{ secrets.GH_TOKEN }}
66+
- name: Setup Ruby 2.6.6
67+
uses: ruby/setup-ruby@v1
68+
with:
69+
ruby-version: 2.6.6
70+
bundler-cache: true
71+
- name: Cache Swift Package Manager
72+
uses: actions/cache@v3
73+
with:
74+
path: |
75+
.build
76+
~/Library/Developer/Xcode/DerivedData/**/SourcePackages/checkouts
77+
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
78+
restore-keys: |
79+
${{ runner.os }}-spm-
80+
- name: Demo application build validation
81+
run: bundle exec fastlane build_example --env ios

.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.

0 commit comments

Comments
 (0)