2019-12-06 21:19:30 +05:30
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build
|
2020-11-05 18:51:18 +05:30
|
|
|
runs-on: ubuntu-latest
|
2019-12-06 21:19:30 +05:30
|
|
|
env:
|
2019-12-09 01:11:28 +05:30
|
|
|
GOFLAGS: -mod=readonly
|
2019-12-06 21:19:30 +05:30
|
|
|
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres:10.8
|
|
|
|
ports:
|
|
|
|
- 5432
|
|
|
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
|
|
|
2021-05-15 10:02:43 +05:30
|
|
|
postgres-ent:
|
|
|
|
image: postgres:10.8
|
|
|
|
ports:
|
|
|
|
- 5432
|
|
|
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
|
|
|
2020-03-18 15:34:42 +05:30
|
|
|
mysql:
|
|
|
|
image: mysql:5.7
|
|
|
|
env:
|
|
|
|
MYSQL_ROOT_PASSWORD: root
|
|
|
|
MYSQL_DATABASE: dex
|
|
|
|
ports:
|
2021-04-26 14:31:24 +05:30
|
|
|
- 3306
|
2020-03-18 15:34:42 +05:30
|
|
|
options: --health-cmd "mysql -proot -e \"show databases;\"" --health-interval 10s --health-timeout 5s --health-retries 5
|
|
|
|
|
2021-09-13 15:55:17 +05:30
|
|
|
mysql-ent:
|
|
|
|
image: mysql:5.7
|
|
|
|
env:
|
|
|
|
MYSQL_ROOT_PASSWORD: root
|
|
|
|
MYSQL_DATABASE: dex
|
|
|
|
ports:
|
|
|
|
- 3306
|
|
|
|
options: --health-cmd "mysql -proot -e \"show databases;\"" --health-interval 10s --health-timeout 5s --health-retries 5
|
|
|
|
|
2019-12-06 21:19:30 +05:30
|
|
|
etcd:
|
2021-06-16 04:10:35 +05:30
|
|
|
image: gcr.io/etcd-development/etcd:v3.5.0
|
2019-12-06 21:19:30 +05:30
|
|
|
ports:
|
|
|
|
- 2379
|
|
|
|
env:
|
|
|
|
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
|
|
|
|
ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
|
|
|
|
options: --health-cmd "ETCDCTL_API=3 etcdctl --endpoints http://localhost:2379 endpoint health" --health-interval 10s --health-timeout 5s --health-retries 5
|
|
|
|
|
|
|
|
keystone:
|
2021-03-11 13:02:25 +05:30
|
|
|
image: openio/openstack-keystone:rocky
|
2019-12-06 21:19:30 +05:30
|
|
|
ports:
|
|
|
|
- 5000
|
|
|
|
- 35357
|
|
|
|
options: --health-cmd "curl --fail http://localhost:5000/v3" --health-interval 10s --health-timeout 5s --health-retries 5
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Set up Go
|
2021-01-15 04:01:53 +05:30
|
|
|
uses: actions/setup-go@v2
|
2019-12-06 21:19:30 +05:30
|
|
|
with:
|
2021-02-17 14:48:26 +05:30
|
|
|
go-version: 1.16
|
2019-12-06 21:19:30 +05:30
|
|
|
|
|
|
|
- name: Checkout code
|
2020-02-21 20:23:13 +05:30
|
|
|
uses: actions/checkout@v2
|
2019-12-06 21:19:30 +05:30
|
|
|
|
2021-02-15 20:54:26 +05:30
|
|
|
- name: Start services
|
|
|
|
run: docker-compose -f docker-compose.test.yaml up -d
|
|
|
|
|
2021-04-19 18:15:12 +05:30
|
|
|
- name: Create kind cluster
|
2021-07-01 09:36:47 +05:30
|
|
|
uses: helm/kind-action@v1.2.0
|
2021-04-19 18:15:12 +05:30
|
|
|
with:
|
2021-06-01 22:03:08 +05:30
|
|
|
version: v0.11.1
|
|
|
|
node_image: kindest/node:v1.19.11@sha256:07db187ae84b4b7de440a73886f008cf903fcf5764ba8106a9fd5243d6f32729
|
2021-04-19 18:15:12 +05:30
|
|
|
|
2021-01-15 04:01:53 +05:30
|
|
|
- name: Test
|
2019-12-06 21:19:30 +05:30
|
|
|
run: make testall
|
|
|
|
env:
|
|
|
|
DEX_MYSQL_DATABASE: dex
|
|
|
|
DEX_MYSQL_USER: root
|
|
|
|
DEX_MYSQL_PASSWORD: root
|
|
|
|
DEX_MYSQL_HOST: 127.0.0.1
|
2021-04-26 14:31:24 +05:30
|
|
|
DEX_MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
|
2021-09-13 15:55:17 +05:30
|
|
|
DEX_MYSQL_ENT_DATABASE: dex
|
|
|
|
DEX_MYSQL_ENT_USER: root
|
|
|
|
DEX_MYSQL_ENT_PASSWORD: root
|
|
|
|
DEX_MYSQL_ENT_HOST: 127.0.0.1
|
|
|
|
DEX_MYSQL_ENT_PORT: ${{ job.services.mysql-ent.ports[3306] }}
|
2019-12-06 21:19:30 +05:30
|
|
|
DEX_POSTGRES_DATABASE: postgres
|
|
|
|
DEX_POSTGRES_USER: postgres
|
|
|
|
DEX_POSTGRES_PASSWORD: postgres
|
|
|
|
DEX_POSTGRES_HOST: localhost
|
|
|
|
DEX_POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
|
2021-05-15 10:02:43 +05:30
|
|
|
DEX_POSTGRES_ENT_DATABASE: postgres
|
|
|
|
DEX_POSTGRES_ENT_USER: postgres
|
|
|
|
DEX_POSTGRES_ENT_PASSWORD: postgres
|
|
|
|
DEX_POSTGRES_ENT_HOST: localhost
|
|
|
|
DEX_POSTGRES_ENT_PORT: ${{ job.services.postgres-ent.ports[5432] }}
|
2019-12-06 21:19:30 +05:30
|
|
|
DEX_ETCD_ENDPOINTS: http://localhost:${{ job.services.etcd.ports[2379] }}
|
2021-02-15 20:54:26 +05:30
|
|
|
DEX_LDAP_HOST: localhost
|
|
|
|
DEX_LDAP_PORT: 389
|
|
|
|
DEX_LDAP_TLS_PORT: 636
|
2019-12-06 21:19:30 +05:30
|
|
|
DEX_KEYSTONE_URL: http://localhost:${{ job.services.keystone.ports[5000] }}
|
|
|
|
DEX_KEYSTONE_ADMIN_URL: http://localhost:${{ job.services.keystone.ports[35357] }}
|
|
|
|
DEX_KEYSTONE_ADMIN_USER: demo
|
|
|
|
DEX_KEYSTONE_ADMIN_PASS: DEMO_PASS
|
2021-04-19 18:15:12 +05:30
|
|
|
DEX_KUBERNETES_CONFIG_PATH: ~/.kube/config
|
2019-12-06 21:19:30 +05:30
|
|
|
|
2021-01-15 04:01:53 +05:30
|
|
|
- name: Lint
|
2019-12-18 19:25:52 +05:30
|
|
|
run: make lint
|
2019-12-06 21:19:30 +05:30
|
|
|
|
|
|
|
# Ensure proto generation doesn't depend on external packages.
|
|
|
|
- name: Verify proto
|
|
|
|
run: make verify-proto
|