Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
112 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
env: | ||
GO111MODULE: on | ||
COMPOSE_DOCKER_CLI_BUILD: 1 | ||
DOCKER_BUILDKIT: 1 | ||
KB_ADDRESS: 127.0.0.1 | ||
KB_PORT: 8080 | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.19' | ||
- name: Download dependencies | ||
run: | | ||
go install golang.org/x/tools/cmd/goimports@latest | ||
go mod download | ||
- name: Start stack | ||
run: | | ||
mkdir -p /var/tmp/tomcat_logs | ||
chmod ugo+rwx /var/tmp/tomcat_logs | ||
cd docker | ||
docker-compose -p it -f docker-compose.ci.mysql.yml up --no-start | ||
docker start it_db_1 | ||
- name: Wait for MySQL | ||
run: | | ||
set +e | ||
count=0 | ||
until mysqladmin ping -h 127.0.0.1 -u root --password=root --silent; do | ||
if [[ "$count" == "25" ]]; then | ||
exit 1 | ||
fi | ||
(( count++ )) | ||
printf '.' | ||
sleep 5 | ||
done | ||
set -e | ||
- name: Start Kill Bill | ||
# Sometimes it gets stuck (if Kill Bill starts when the DB isn't ready?) | ||
timeout-minutes: 4 | ||
run: | | ||
# Start all remaining containers | ||
cd docker | ||
docker-compose -p it -f docker-compose.ci.mysql.yml up -d | ||
count=0 | ||
until $(curl --connect-timeout 10 --max-time 30 --output /dev/null --silent --fail http://${KB_ADDRESS}:${KB_PORT}/1.0/healthcheck); do | ||
if [[ "$count" == "180" ]]; then | ||
exit 64 | ||
fi | ||
count=$(( count + 1 )) | ||
sleep 1 | ||
done | ||
- name: Build and run tests | ||
if: success() | ||
run: | | ||
export PATH="$HOME/go/bin:$PATH" | ||
go test ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# | ||
# Copyright 2020-2022 Equinix, Inc | ||
# Copyright 2014-2022 The Billing Project, LLC | ||
# | ||
# The Billing Project licenses this file to you under the Apache License, version 2.0 | ||
# (the "License"); you may not use this file except in compliance with the | ||
# License. You may obtain a copy of the License at: | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
version: '3.8' | ||
|
||
services: | ||
killbill: | ||
network_mode: host | ||
image: killbill/killbill:0.24.0 | ||
environment: | ||
- KILLBILL_CATALOG_URI=SpyCarAdvanced.xml | ||
- KILLBILL_DAO_URL=jdbc:mysql://127.0.0.1:3306/killbill | ||
- KILLBILL_DAO_USER=root | ||
- KILLBILL_DAO_PASSWORD=root | ||
- KILLBILL_SERVER_TEST_MODE=true | ||
- KILLBILL_INVOICE_SANITY_SAFETY_BOUND_ENABLED=false | ||
- KILLBILL_INVOICE_MAX_DAILY_NUMBER_OF_ITEMS_SAFETY_BOUND=-1 | ||
depends_on: | ||
- db | ||
volumes: | ||
- /var/tmp/bundles/plugins/java/invgrp-plugin:/var/lib/killbill/bundles/plugins/java/invgrp-plugin | ||
- /var/tmp/tomcat_logs:/var/lib/tomcat/logs | ||
db: | ||
network_mode: host | ||
image: killbill/mariadb:0.24 | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters