This repository has been archived by the owner on May 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 294
75 lines (61 loc) · 2.56 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: CI for stripe-samples/accept-a-card-payment
on:
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
repository: 'stripe-samples/sample-ci'
path: 'sample-ci'
- name: Setup dependencies
run: |
source sample-ci/helpers.sh
setup_dependencies
- name: Run tests
run: |
source sample-ci/helpers.sh
install_docker_compose_settings
export STRIPE_WEBHOOK_SECRET=$(retrieve_webhook_secret)
export COMPOSE_FILE=docker-compose.yml:docker-compose.selenium.yml
echo "SELENIUM_URL=http://selenium:4444/wd/hub" >> .env
for lang in $(cat .cli.json | server_langs_for_integration decline-on-card-authentication)
do
[ "$lang" = "php" ] && continue
configure_docker_compose_for_integration decline-on-card-authentication "$lang" ../../client/web
docker-compose up -d && wait_web_server
docker-compose exec -T runner bundle exec rspec spec/decline_on_card_authentication_spec.rb
done
for lang in $(cat .cli.json | server_langs_for_integration using-webhooks)
do
[ "$lang" = "php" ] && continue
configure_docker_compose_for_integration using-webhooks "$lang" ../../client/web
docker-compose up -d && wait_web_server
if [ "$lang" = "java" ]; then
docker-compose exec -T runner bundle exec rspec spec/using_webhooks_spec.rb
else
docker-compose exec -T -e SERVER_ROOT_PATH=/checkout runner bundle exec rspec spec/using_webhooks_spec.rb
fi
done
for lang in $(cat .cli.json | server_langs_for_integration without-webhooks)
do
[ "$lang" = "php" ] && continue
configure_docker_compose_for_integration without-webhooks "$lang" ../../client/web
docker-compose up -d && wait_web_server
docker-compose exec -T runner bundle exec rspec spec/without_webhooks_spec.rb
done
env:
STRIPE_PUBLISHABLE_KEY: ${{ secrets.TEST_STRIPE_PUBLISHABLE_KEY }}
STRIPE_SECRET_KEY: ${{ secrets.TEST_STRIPE_SECRET_KEY }}
PREMIUM: ${{ secrets.TEST_PREMIUM_PRICE }}
BASIC: ${{ secrets.TEST_BASIC_PRICE }}
- name: Collect debug information
if: ${{ failure() }}
run: |
cat docker-compose.yml
docker-compose ps -a
docker-compose logs web