hardcode db password in CI to allow tests from third parties (#1729)

This commit is contained in:
mmetc 2022-09-01 16:49:12 +02:00 committed by GitHub
parent ea40ffd655
commit c4652d60a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 21 deletions

View file

@ -6,9 +6,6 @@ on:
database_image: database_image:
required: true required: true
type: string type: string
secrets:
DATABASE_PASSWORD:
required: true
env: env:
PREFIX_TEST_NAMES_WITH_FILE: true PREFIX_TEST_NAMES_WITH_FILE: true
@ -23,7 +20,7 @@ jobs:
database: database:
image: ${{ inputs.database_image }} image: ${{ inputs.database_image }}
env: env:
MYSQL_ROOT_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} MYSQL_ROOT_PASSWORD: "secret"
ports: ports:
- 3306:3306 - 3306:3306
@ -61,7 +58,7 @@ jobs:
DB_BACKEND: mysql DB_BACKEND: mysql
MYSQL_HOST: 127.0.0.1 MYSQL_HOST: 127.0.0.1
MYSQL_PORT: 3306 MYSQL_PORT: 3306
MYSQL_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} MYSQL_PASSWORD: "secret"
MYSQL_USER: root MYSQL_USER: root
- name: "Run tests" - name: "Run tests"
@ -70,7 +67,7 @@ jobs:
DB_BACKEND: mysql DB_BACKEND: mysql
MYSQL_HOST: 127.0.0.1 MYSQL_HOST: 127.0.0.1
MYSQL_PORT: 3306 MYSQL_PORT: 3306
MYSQL_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} MYSQL_PASSWORD: "secret"
MYSQL_USER: root MYSQL_USER: root
# #
@ -85,7 +82,7 @@ jobs:
DB_BACKEND: mysql DB_BACKEND: mysql
MYSQL_HOST: 127.0.0.1 MYSQL_HOST: 127.0.0.1
MYSQL_PORT: 3306 MYSQL_PORT: 3306
MYSQL_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} MYSQL_PASSWORD: "secret"
MYSQL_USER: root MYSQL_USER: root
if: ${{ always() }} if: ${{ always() }}

View file

@ -2,9 +2,6 @@ name: Functional tests (Postgres)
on: on:
workflow_call: workflow_call:
secrets:
DATABASE_PASSWORD:
required: true
env: env:
PREFIX_TEST_NAMES_WITH_FILE: true PREFIX_TEST_NAMES_WITH_FILE: true
@ -19,7 +16,7 @@ jobs:
database: database:
image: postgres:latest image: postgres:latest
env: env:
POSTGRES_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} POSTGRES_PASSWORD: "secret"
ports: ports:
- 5432:5432 - 5432:5432
options: >- options: >-
@ -62,7 +59,7 @@ jobs:
DB_BACKEND: pgx DB_BACKEND: pgx
PGHOST: 127.0.0.1 PGHOST: 127.0.0.1
PGPORT: 5432 PGPORT: 5432
PGPASSWORD: ${{ secrets.DATABASE_PASSWORD }} PGPASSWORD: "secret"
PGUSER: postgres PGUSER: postgres
- name: "Run tests (DB_BACKEND: pgx)" - name: "Run tests (DB_BACKEND: pgx)"
@ -71,7 +68,7 @@ jobs:
DB_BACKEND: pgx DB_BACKEND: pgx
PGHOST: 127.0.0.1 PGHOST: 127.0.0.1
PGPORT: 5432 PGPORT: 5432
PGPASSWORD: ${{ secrets.DATABASE_PASSWORD }} PGPASSWORD: "secret"
PGUSER: postgres PGUSER: postgres
- name: "Build crowdsec and fixture (DB_BACKEND: postgres)" - name: "Build crowdsec and fixture (DB_BACKEND: postgres)"
@ -80,7 +77,7 @@ jobs:
DB_BACKEND: postgres DB_BACKEND: postgres
PGHOST: 127.0.0.1 PGHOST: 127.0.0.1
PGPORT: 5432 PGPORT: 5432
PGPASSWORD: ${{ secrets.DATABASE_PASSWORD }} PGPASSWORD: "secret"
PGUSER: postgres PGUSER: postgres
- name: "Run tests (DB_BACKEND: postgres)" - name: "Run tests (DB_BACKEND: postgres)"
@ -89,7 +86,7 @@ jobs:
DB_BACKEND: postgres DB_BACKEND: postgres
PGHOST: 127.0.0.1 PGHOST: 127.0.0.1
PGPORT: 5432 PGPORT: 5432
PGPASSWORD: ${{ secrets.DATABASE_PASSWORD }} PGPASSWORD: "secret"
PGUSER: postgres PGUSER: postgres
- name: "Show crowdsec logs" - name: "Show crowdsec logs"

View file

@ -34,20 +34,14 @@ jobs:
uses: ./.github/workflows/bats-mysql.yml uses: ./.github/workflows/bats-mysql.yml
with: with:
database_image: mariadb:latest database_image: mariadb:latest
secrets:
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD}}
mysql: mysql:
uses: ./.github/workflows/bats-mysql.yml uses: ./.github/workflows/bats-mysql.yml
with: with:
database_image: mysql:latest database_image: mysql:latest
secrets:
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD}}
postgres: postgres:
uses: ./.github/workflows/bats-postgres.yml uses: ./.github/workflows/bats-postgres.yml
secrets:
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD}}
hub: hub:
uses: ./.github/workflows/bats-hub.yml uses: ./.github/workflows/bats-hub.yml