Skip to content

Commit 4e8caab

Browse files
authored
Migrate CI/CD to GIthub Actions (#15)
1 parent b9d935c commit 4e8caab

File tree

5 files changed

+55
-2
lines changed

5 files changed

+55
-2
lines changed

.github/workflows/main.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Test Code Runner
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Check passphrase
19+
run: echo $PLAINTEXT
20+
env:
21+
DEBUG_PHRASE: ${{ secrets.GPG_PASSPHRASE }}
22+
PLAINTEXT: $DEBUG_PHRASE
23+
24+
- name: Decrypt large secret
25+
run: ./decrypt_secret.sh
26+
env:
27+
LARGE_SECRET_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
28+
29+
- uses: php-actions/composer@v5
30+
with:
31+
php_version: 7.2
32+
33+
- name: PHPUnit Tests
34+
uses: php-actions/phpunit@v2
35+
env:
36+
XDEBUG_MODE: coverage
37+
with:
38+
version: 8
39+
php_version: 7.2
40+
bootstrap: vendor/autoload.php
41+
php_extensions: xdebug
42+
configuration: phpunit.xml
43+
args: tests --coverage-clover ./coverage.xml
44+
45+
- uses: codecov/codecov-action@v3
46+
with:
47+
files: ./clover.xml

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
# php-fcm-v1
3-
[![Build Status](https://travis-ci.org/lkaybob/php-fcm-v1.svg?branch=master)](https://travis-ci.org/lkaybob/php-fcm-v1)
3+
[![Build Status](https://github.com/lkaybob/php-fcm-v1/actions/workflows/main.yml/badge.svg)](https://github.com/lkaybob/php-fcm-v1/actions)
44
[![codecov](https://codecov.io/gh/lkaybob/php-fcm-v1/branch/master/graph/badge.svg)](https://codecov.io/gh/lkaybob/php-fcm-v1)
55
[![Latest Stable Version](https://poser.pugx.org/lkaybob/php-fcm-v1/v/stable)](https://packagist.org/packages/lkaybob/php-fcm-v1)
66
[![Total Downloads](https://poser.pugx.org/lkaybob/php-fcm-v1/downloads)](https://packagist.org/packages/lkaybob/php-fcm-v1)
@@ -140,4 +140,4 @@ HTTP v1 API, in contrast, leverages OAuth2 security model. You need to get an ac
140140
- [ ] Implement simultaneous send (Currently supports single recipient or topic one at a time)
141141
- [ ] Setup Read the Docs
142142
- [x] Add CI Test
143-
- [x] Add CodeCov Badge
143+
- [x] Add CodeCov Badge

decrypt_secret.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
# Decrypt the file
4+
gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" \
5+
--output service_account.json service_account.json.gpg
6+

service_account.json.enc

-2.34 KB
Binary file not shown.

service_account.json.gpg

1.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)