Skip to content

Commit

Permalink
Split tests and add smoke for log4shell-goof-server
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric committed Jan 31, 2022
1 parent 7cf8304 commit 50edd00
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 19 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/log4shell-goof-server-docker-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: log4shell-goof-server Docker image build and test

on:
push:
branches:
- 'main'
paths:
- 'log4shell-goof/log4shell-goof-server/**'
- '.github/workflows/log4shell-goof-server-docker-image.yaml'
pull_request:
branches:
- 'main'
paths:
- 'log4shell-goof/log4shell-goof-server/**'
- '.github/workflows/log4shell-goof-server-docker-image.yaml'
jobs:

build-log4shell-server-image:
runs-on: ubuntu-latest
defaults:
run:
working-directory: log4shell-goof/log4shell-server
steps:
- uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build
uses: docker/build-push-action@v2
with:
load: true
context: log4shell-goof/log4shell-server
push: false
tags: log4shell-server:latest

- name: Run container
run: docker run -d --rm --name log4shell-server log4shell-server:latest && sleep 5

- name: Smoke test LDAP running in container
run: docker logs log4shell-server | grep "LDAP server listening on 0.0.0.0:8000"

- name: Smoke test HTTP running in container
run: docker logs log4shell-server | grep "HTTP server listening on 0.0.0.0:9999"

- name: Cleanup container
run: docker kill log4shell-server
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
name: Docker Image Java-Goof
name: todolost-goof Docker image build and test

on:
push:
branches:
- 'main'
paths:
- 'todolist-goof/**'
- '.github/workflows/todolist-goof-docker-image.yaml'
pull_request:
branches:
- 'main'
paths:
- 'todolist-goof/**'
- '.github/workflows/todolist-goof-docker-image.yaml'

jobs:
build-todolist-image:
Expand Down Expand Up @@ -32,21 +42,3 @@ jobs:

- name: Cleanup container
run: docker kill java-goof

build-log4shell-server-image:
runs-on: ubuntu-latest
defaults:
run:
working-directory: log4shell-goof/log4shell-server
steps:
- uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build
uses: docker/build-push-action@v2
with:
context: log4shell-goof/log4shell-server
push: false
tags: log4shell-server:latest

0 comments on commit 50edd00

Please sign in to comment.