-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
0c27dc1
commit 07f1a2d
Showing
2 changed files
with
55 additions
and
19 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 |
---|---|---|
|
@@ -9,12 +9,12 @@ jobs: | |
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
node-version: 20 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
@@ -29,10 +29,11 @@ jobs: | |
eslint_extensions: ts | ||
|
||
- name: OpenAPI Lint Checks | ||
if: ${{ inputs.enableOpenApiCheck == true }} | ||
uses: nwestfall/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ./openapi3.yaml | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ${{ inputs.openApiFilePath }} | ||
|
||
tests: | ||
name: Run Tests | ||
|
@@ -46,7 +47,6 @@ jobs: | |
image: redis | ||
# Provide the password for postgres | ||
env: | ||
REDIS_HOST: localhost | ||
REDIS_PORT: 6379 | ||
REDIS_USERNAME: "" | ||
REDIS_PASSWORD: "" | ||
|
@@ -60,22 +60,31 @@ jobs: | |
--health-timeout 5s | ||
--health-retries 5 | ||
zookeeper: | ||
image: bitnami/zookeeper:3.8.0 | ||
ports: | ||
- 2181:2181 | ||
env: | ||
ALLOW_ANONYMOUS_LOGIN: yes | ||
|
||
kafka: | ||
# Docker Hub image | ||
image: apache/kafka:3.8.0 | ||
# Provide the password for postgres | ||
image: bitnami/kafka:3.8.0 | ||
ports: | ||
- 9092:9092 | ||
env: | ||
KAFKA_BROKERS: localhost:9092 | ||
# Set health checks to wait until postgres has started | ||
|
||
outputTopic: | ||
image: '' | ||
env: | ||
KAFKA_OUTPUT_TOPIC: testTopic | ||
KAFKA_BROKER_ID: 1 | ||
KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181 | ||
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 | ||
ALLOW_PLAINTEXT_LISTENER: yes | ||
options: >- | ||
--health-cmd "kafka-topics.sh --bootstrap-server localhost:9092 --list || exit 1" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
strategy: | ||
matrix: | ||
node: [14.x, 16.x] | ||
node: [18.x, 20.x] | ||
|
||
steps: | ||
- name: Check out Git repository | ||
|
@@ -89,14 +98,41 @@ jobs: | |
- name: Install Node.js dependencies | ||
run: npm ci | ||
|
||
- name: Install Docker | ||
run: | | ||
apt-get update | ||
apt-get install -y docker.io | ||
- name: Wait for Kafka | ||
run: | | ||
until docker exec $(docker ps -qf "name=kafka") kafka-topics.sh --list --bootstrap-server localhost:9092; do | ||
echo "Waiting for Kafka to be ready..."; | ||
sleep 5; | ||
done | ||
- name: Create Kafka testTopic | ||
run: | | ||
docker exec $(docker ps -qf "name=kafka") \ | ||
kafka-topics.sh --create --topic testTopic --bootstrap-server localhost:9092 | ||
- name: Run tests | ||
run: npm run test | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: Test Reporters | ||
name: Test Reporters (Node ${{ matrix.node }}) | ||
path: reports/** | ||
|
||
security: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Run Snyk to check for vulnerabilities | ||
uses: snyk/actions/node@master | ||
continue-on-error: true | ||
env: | ||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
|
||
build_image: | ||
name: Build Image | ||
runs-on: ubuntu-latest | ||
|
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