forked from razorpay/razorpay-php
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (37 loc) · 1.36 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: CI
on:
push:
branches:
- master
tags:
- v[0-9]+.[0-9]+.[0-9]+*
pull_request:
branches:
- master
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up php 8.0
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
- name: 'Create env file'
run: |
touch ${{ github.workspace }}/tests/.env
echo RAZORPAY_API_KEY=${{ secrets.RAZORPAY_API_KEY }} >> ${{ github.workspace }}/tests/.env
echo RAZORPAY_API_SECRET=${{ secrets.RAZORPAY_API_SECRET }} >> ${{ github.workspace }}/tests/.env
cat ${{ github.workspace }}/tests/.env
- name: Install dependencies
run: composer self-update && composer install && composer require vlucas/phpdotenv && composer dump-autoload
- name: Run tests and collect coverage
run: vendor/bin/phpunit ./tests/CoverageTest.php --coverage-clover coverage.xml .
env:
RAZORPAY_API_KEY: ${{ secrets.RAZORPAY_API_KEY }}
RAZORPAY_API_SECRET: ${{ secrets.RAZORPAY_API_SECRET }}
RAZORPAY_PARTNER_API_KEY: ${{ secrets.RAZORPAY_PARTNER_API_KEY }}
RAZORPAY_PARTNER_API_SECRET: ${{ secrets.RAZORPAY_PARTNER_API_SECRET }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3