Skip to content

Commit f3e9b63

Browse files
committed
Merge branch 'remove-docker' #minor
2 parents 4818619 + 887aa68 commit f3e9b63

File tree

2 files changed

+66
-97
lines changed

2 files changed

+66
-97
lines changed

.github/workflows/ccpp.yml

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -114,55 +114,55 @@ jobs:
114114
with:
115115
name: windows-build
116116
path: duplo-windows.zip
117-
push-docker-image:
118-
runs-on: ubuntu-latest
119-
needs: [bump-tag-dry]
120-
steps:
121-
- name: download artifacts
122-
uses: actions/download-artifact@v4
123-
with:
124-
name: tag-txt
125-
path: uploads
126-
127-
- name: set version
128-
id: version
129-
run: |
130-
DUPLO_VERSION=$(cat ./uploads/tag.txt)
131-
echo $DUPLO_VERSION
132-
echo "DUPLO_VERSION=$DUPLO_VERSION" >> $GITHUB_ENV
133-
echo "DUPLO_VERSION=$DUPLO_VERSION" >> $GITHUB_OUTPUT
134-
135-
- uses: actions/checkout@v4
136-
with:
137-
fetch-depth: '0'
138-
139-
- name: Set up Docker Buildx
140-
uses: docker/setup-buildx-action@v3
141-
142-
- name: Login to Docker Hub
143-
if: github.event_name != 'pull_request'
144-
uses: docker/login-action@v3
145-
with:
146-
username: ${{ secrets.DOCKER_USERNAME }}
147-
password: ${{ secrets.DOCKER_PASSWORD }}
148-
149-
- name: Docker build
150-
if: github.event_name == 'pull_request'
151-
uses: docker/build-push-action@v5
152-
with:
153-
push: false
154-
tags: "dlidstrom/duplo:${{ steps.version.outputs.DUPLO_VERSION }}"
155-
build-args: |
156-
"DUPLO_VERSION=${{ steps.version.outputs.DUPLO_VERSION }}"
157-
158-
- name: Docker build and push
159-
if: github.event_name != 'pull_request'
160-
uses: docker/build-push-action@v5
161-
with:
162-
push: true
163-
tags: "dlidstrom/duplo:latest,dlidstrom/duplo:${{ steps.version.outputs.DUPLO_VERSION }}"
164-
build-args: |
165-
"DUPLO_VERSION=${{ steps.version.outputs.DUPLO_VERSION }}"
117+
# push-docker-image:
118+
# runs-on: ubuntu-latest
119+
# needs: [bump-tag-dry]
120+
# steps:
121+
# - name: download artifacts
122+
# uses: actions/download-artifact@v4
123+
# with:
124+
# name: tag-txt
125+
# path: uploads
126+
#
127+
# - name: set version
128+
# id: version
129+
# run: |
130+
# DUPLO_VERSION=$(cat ./uploads/tag.txt)
131+
# echo $DUPLO_VERSION
132+
# echo "DUPLO_VERSION=$DUPLO_VERSION" >> $GITHUB_ENV
133+
# echo "DUPLO_VERSION=$DUPLO_VERSION" >> $GITHUB_OUTPUT
134+
#
135+
# - uses: actions/checkout@v4
136+
# with:
137+
# fetch-depth: '0'
138+
#
139+
# - name: Set up Docker Buildx
140+
# uses: docker/setup-buildx-action@v3
141+
#
142+
# - name: Login to Docker Hub
143+
# if: github.event_name != 'pull_request'
144+
# uses: docker/login-action@v3
145+
# with:
146+
# username: ${{ secrets.DOCKER_USERNAME }}
147+
# password: ${{ secrets.DOCKER_PASSWORD }}
148+
#
149+
# - name: Docker build
150+
# if: github.event_name == 'pull_request'
151+
# uses: docker/build-push-action@v5
152+
# with:
153+
# push: false
154+
# tags: "dlidstrom/duplo:${{ steps.version.outputs.DUPLO_VERSION }}"
155+
# build-args: |
156+
# "DUPLO_VERSION=${{ steps.version.outputs.DUPLO_VERSION }}"
157+
#
158+
# - name: Docker build and push
159+
# if: github.event_name != 'pull_request'
160+
# uses: docker/build-push-action@v5
161+
# with:
162+
# push: true
163+
# tags: "dlidstrom/duplo:latest,dlidstrom/duplo:${{ steps.version.outputs.DUPLO_VERSION }}"
164+
# build-args: |
165+
# "DUPLO_VERSION=${{ steps.version.outputs.DUPLO_VERSION }}"
166166

167167
upload-release:
168168
if: success()

README.md

Lines changed: 17 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
**Updates:**
88

9-
- 🔥 Introducing [duplo-action](https://github.com/dlidstrom/duplo-action) for using Duplo in GitHub Actions!
9+
- 🔥 v1.2 support for reporting in json format (thanks [@cgkantidis](https://github.com/cgkantidis)!)
10+
- [Performance improvements](#71-performance-measurements): it now takes ~9s to process Quake 2 source! (thanks [@cgkantidis](https://github.com/cgkantidis)!)
11+
- Introducing [duplo-action](https://github.com/dlidstrom/duplo-action) for using Duplo in GitHub Actions!
1012
- v1.1 improve memory usage (grabbed from [@nachose fork](https://github.com/nachose/Duplo)), also re-enabled tests and organized code
1113
- 🚀 v1.0 add build on Windows (thanks [@chausner](https://github.com/chausner)!)
1214
- v0.8 adds improved Java support
@@ -64,15 +66,14 @@ find . -type f \( -iname "*.cpp" -o -iname "*.h" \) | ./duplo -ml 20 -ip - -
6466
- [2. Maintainer](#2-maintainer)
6567
- [3. File Format Support](#3-file-format-support)
6668
- [4. Installation](#4-installation)
67-
- [4.1. Docker](#41-docker)
68-
- [4.2. Pre-built binaries](#42-pre-built-binaries)
69+
- [4.1. Pre-built binaries](#41-pre-built-binaries)
6970
- [5. Usage](#5-usage)
7071
- [5.1. Passing files using `stdin`](#51-passing-files-using-stdin)
7172
- [5.1.1. Bash](#511-bash)
7273
- [5.1.2. Windows](#512-windows)
73-
- [5.1.3. Docker](#513-docker)
7474
- [5.2. Passing files using file](#52-passing-files-using-file)
75-
- [5.3. Xml output](#53-xml-output)
75+
- [5.3. Json output](#53-json-output)
76+
- [5.4. Xml output](#54-xml-output)
7677
- [6. Feedback and Bug Reporting](#6-feedback-and-bug-reporting)
7778
- [7. Algorithm Background](#7-algorithm-background)
7879
- [7.1. Performance Measurements](#71-performance-measurements)
@@ -137,19 +138,7 @@ src\engine\geometry\SkinnedMeshGeometry.cpp(45)
137138

138139
## 4. Installation
139140

140-
### 4.1. Docker
141-
142-
If you have Docker, the way to run Duplo is to use this command:
143-
144-
```bash
145-
# Docker on unix
146-
> docker run --rm -i -w /src -v $(pwd):/src dlidstrom/duplo
147-
```
148-
149-
This pulls the latest image and runs duplo. Note that you'll have to pipe the
150-
filenames into this command. A complete commandline sample will be shown below.
151-
152-
### 4.2. Pre-built binaries
141+
### 4.1. Pre-built binaries
153142

154143
Duplo is also available as a pre-built binary for (Alpine) Linux, macOS and
155144
Windows. Grab the executable from the
@@ -194,30 +183,6 @@ written to `out.txt`.
194183
This works similarly to the Bash command, but uses PowerShell commands to
195184
achieve the same effect.
196185

197-
#### 5.1.3. Docker
198-
199-
```bash
200-
# Docker on unix
201-
> find . -type f \( -iname "*.cpp" -or -iname "*.h" \) | docker run --rm -i -w /src -v $(pwd):/src dlidstrom/duplo - out.txt
202-
```
203-
204-
This command also works in a similar fashion to the Bash command, but instead of
205-
piping into a local `duplo` executable, it will pipe into `duplo` running inside
206-
Docker. This is very convenient as you do not have to install `duplo`
207-
separately. You will have to install Docker though, if you haven't already. That
208-
is a good thing to do anyway, since it opens up a lot of possibilities apart
209-
from running `duplo`.
210-
211-
Again, similarly to the Bash command, this uses `find` to find files in the
212-
current directory, then passes the file list to Docker which will pass it
213-
further into an instance of the latest version of `duplo`. The working directory
214-
in the `duplo` container should be `/src` (that's where the `duplo` executable
215-
is located) and the current path of your host machine will be mapped to `/src`
216-
when the container is running. The `-i` allows `stdin` of your host machine to
217-
be passed into Docker to allow `duplo` to read the filenames. Any parameters to
218-
`duplo` can be placed at the end of the command as you can see `- out.txt` has
219-
been.
220-
221186
### 5.2. Passing files using file
222187

223188
`duplo` can analyze files specified in a separate file:
@@ -230,15 +195,16 @@ been.
230195
# windows
231196
> Get-ChildItem -Include "*.cpp", "*.h" -Recurse | % { $_.FullName } | Out-File -encoding ascii files.lst
232197
> Duplo.exe files.lst out.txt
233-
234-
# Docker on unix
235-
> find . -type f \( -iname "*.cpp" -o -iname "*.h" \) > files.lst
236-
> docker run --rm -i -w /src -v $(pwd):/src dlidstrom/duplo files.lst out.txt
237198
```
238199
239200
Again, the duplicated blocks are written to `out.txt`.
240201
241-
### 5.3. Xml output
202+
### 5.3. Json output
203+
204+
Using `-json <filename>` you can output the result as json. This may be useful
205+
if you want to process the result further.
206+
207+
### 5.4. Xml output
242208
243209
Duplo can also output xml and there is a stylesheet that will format the result
244210
for viewing in a browser. This can be used as a report tab in your continuous
@@ -258,7 +224,10 @@ for further information.
258224
259225
| System | Files | Loc's | Time |
260226
|-|-|-|-|
261-
| Quake2 | 266 | 102740 | 18sec |
227+
| Quake2 | 266 | 102740 | 9sec |
228+
229+
This was measured on modern hardware anno 2025. It means Duplo is able to
230+
process more than 10 thousand lines of code (or 26 files) per second.
262231
263232
## 8. Developing
264233

0 commit comments

Comments
 (0)