Skip to content

Commit 7a2293d

Browse files
author
Sebastian Molenda
authored
Merge branch 'master' into feature/add-space-id-and-message-type
2 parents 9759e93 + fa08b85 commit 7a2293d

8 files changed

Lines changed: 140 additions & 172 deletions

File tree

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
* @seba-aln @phairow @MikeDobrzan @marcin-cebo @mohitpubnub
2-
.github/* @parfeon @seba-aln @phairow @MikeDobrzan @marcin-cebo @mohitpubnub
1+
* @seba-aln @MikeDobrzan @marcin-cebo @mohitpubnub
2+
.github/* @parfeon @seba-aln @MikeDobrzan @marcin-cebo @mohitpubnub
33
README.md @techwritermat @kazydek

.github/workflows/commands-handler.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,41 @@ name: Commands processor
33
on:
44
issue_comment:
55
types: [created]
6+
defaults:
7+
run:
8+
shell: bash
69

710
jobs:
811
process:
912
name: Process command
10-
if: ${{ github.event.issue.pull_request && endsWith(github.repository, '-private') != true && startsWith(github.event.comment.body, '@client-engineering-bot ') }}
13+
if: github.event.issue.pull_request && endsWith(github.repository, '-private') != true
1114
runs-on: ubuntu-latest
1215
steps:
16+
- name: Check referred user
17+
id: user-check
18+
env:
19+
CLEN_BOT: ${{ secrets.CLEN_BOT }}
20+
run: echo "expected-user=${{ startsWith(github.event.comment.body, format('@{0} ', env.CLEN_BOT)) }}" >> $GITHUB_OUTPUT
21+
- name: Regular comment
22+
if: steps.user-check.outputs.expected-user != 'true'
23+
run: echo -e "\033[38;2;19;181;255mThis is regular commit which should be ignored.\033[0m"
1324
- name: Checkout repository
14-
uses: actions/checkout@v2
25+
if: steps.user-check.outputs.expected-user == 'true'
26+
uses: actions/checkout@v3
27+
with:
28+
token: ${{ secrets.GH_TOKEN }}
1529
- name: Checkout release actions
16-
uses: actions/checkout@v2
30+
if: steps.user-check.outputs.expected-user == 'true'
31+
uses: actions/checkout@v3
1732
with:
1833
repository: pubnub/client-engineering-deployment-tools
1934
ref: v1
2035
token: ${{ secrets.GH_TOKEN }}
2136
path: .github/.release/actions
2237
- name: Process changelog entries
38+
if: steps.user-check.outputs.expected-user == 'true'
2339
uses: ./.github/.release/actions/actions/commands
2440
with:
2541
token: ${{ secrets.GH_TOKEN }}
26-
listener: client-engineering-bot
27-
jira-api-key: ${{ secrets.JIRA_API_KEY }}
42+
listener: ${{ secrets.CLEN_BOT }}
43+
jira-api-key: ${{ secrets.JIRA_API_KEY }}

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
check-release:
1111
name: Check release required
1212
runs-on: ubuntu-latest
13-
if: ${{ github.event.pull_request.merged && endsWith(github.repository, '-private') != true }}
13+
if: github.event.pull_request.merged && endsWith(github.repository, '-private') != true
1414
outputs:
1515
release: ${{ steps.check.outputs.ready }}
1616
steps:
@@ -30,15 +30,15 @@ jobs:
3030
name: Publish package
3131
runs-on: ubuntu-latest
3232
needs: check-release
33-
if: ${{ needs.check-release.outputs.release == 'true' }}
33+
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

.github/workflows/run-tests.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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: ubuntu-latest
17+
strategy:
18+
max-parallel: 1
19+
fail-fast: true
20+
matrix:
21+
php: [5.6, 7.0, 7.1, 7.2, 7.3, 7.4]
22+
env:
23+
PUBLISH_KEY: ${{ secrets.PUBLISH_KEY }}
24+
SUBSCRIBE_KEY: ${{ secrets.SUBSCRIBE_KEY }}
25+
SECRET_KEY: ${{ secrets.SECRET_KEY }}
26+
PUBLISH_PAM_KEY: ${{ secrets.PUBLISH_PAM_KEY }}
27+
SUBSCRIBE_PAM_KEY: ${{ secrets.SUBSCRIBE_PAM_KEY }}
28+
SECRET_PAM_KEY: ${{ secrets.SECRET_PAM_KEY }}
29+
UUID_MOCK: "test-user"
30+
steps:
31+
- name: Checkout project
32+
uses: actions/checkout@v3
33+
- name: Checkout actions
34+
uses: actions/checkout@v3
35+
with:
36+
repository: pubnub/client-engineering-deployment-tools
37+
ref: v1
38+
token: ${{ secrets.GH_TOKEN }}
39+
path: .github/.release/actions
40+
- name: Determine composer cache directory
41+
id: composer-cache-dir
42+
run: echo "dir=$(composer config cache-dir)" >> $GITHUB_OUTPUT
43+
- name: Cache Composer
44+
uses: actions/cache@v3
45+
with:
46+
path: |
47+
"${{ steps.composer-cache-dir.outputs.dir }}"
48+
${{ github.workspace }}/vendor
49+
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
50+
restore-keys: |
51+
${{ runner.os }}-composer-
52+
- name: Setup PHP ${{ matrix.php }}
53+
uses: shivammathur/setup-php@v2
54+
with:
55+
php-version: ${{ matrix.php }}
56+
tools: phpunit
57+
coverage: none
58+
- name: Setup dependencies
59+
run: |
60+
composer self-update && composer --version
61+
composer install --prefer-dist
62+
- name: Run unit tests
63+
run: vendor/bin/phpunit --verbose
64+
- name: Cancel workflow runs for commit on error
65+
if: failure()
66+
uses: ./.github/.release/actions/actions/utils/fast-jobs-failure
67+
all-tests:
68+
name: Tests
69+
runs-on: ubuntu-latest
70+
needs: [tests]
71+
steps:
72+
- name: Tests summary
73+
run: echo -e "\033[38;2;95;215;0m\033[1mAll tests successfully passed"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
pubnub-yml:
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+
- name: Cancel workflow runs for commit on error
32+
if: failure()
33+
uses: ./.github/.release/actions/actions/utils/fast-jobs-failure
34+
all-validations:
35+
name: Validations
36+
runs-on: ubuntu-latest
37+
needs: [pubnub-yml]
38+
steps:
39+
- name: Validations summary
40+
run: echo -e "\033[38;2;95;215;0m\033[1mAll validations passed"

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

Lines changed: 0 additions & 25 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 & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)