Skip to content

Commit 9ecd093

Browse files
committed
chg: dev: make sure everybody has a version, fix msvc bat file
* add git dep for build-deb-action container versioning * remove exrtraneous make step in debian/rules, add explicit target * remove erroneous cleaning of version file from batch file * add gh-describe action and pass version to batch file * give mingw some fetch-depth or install git in specific runner envs * convert readme to rst (needs render check) Signed-off-by: Stephen L Arnold <nerdboy@gentoo.org>
1 parent cf4557b commit 9ecd093

File tree

8 files changed

+71
-42
lines changed

8 files changed

+71
-42
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,16 @@ jobs:
6363
with:
6464
fetch-depth: 0
6565

66-
- name: Get version
67-
id: get_version
68-
run: |
69-
echo "VERSION=$(git describe --tags)" >> $GITHUB_ENV
70-
echo ${{ env.VERSION }}
66+
- name: Git describe
67+
id: ghd
68+
uses: proudust/gh-describe@v1
7169

7270
- name: Install and setup MSYS2 mingw
7371
if: runner.os == 'Windows' && matrix.compiler == 'mingw-w64'
7472
uses: msys2/setup-msys2@v2
7573
with:
7674
msystem: MINGW64
77-
install: mingw-w64-x86_64-toolchain make gcc diffutils
75+
install: mingw-w64-x86_64-toolchain make gcc diffutils git
7876

7977
- name: Build and test windows mingw
8078
if: runner.os == 'Windows' && matrix.compiler == 'mingw-w64'
@@ -89,7 +87,7 @@ jobs:
8987
- name: Build and test windows MSVC
9088
if: runner.os == 'Windows' && matrix.compiler == 'cl'
9189
run: |
92-
.\build_msvc.bat --version ${{ env.VERSION }}
90+
.\build_msvc.bat --version ${{ steps.ghd.outputs.describe }}
9391
9492
- name: Install and setup Linux packages
9593
if: runner.os == 'Linux'

.github/workflows/debs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
with:
4949
docker-image: "debian:${{ matrix.dist }}-slim"
5050
buildpackage-opts: --build=binary --no-sign
51+
extra-build-deps: git
5152

5253
- name: Upload deb files
5354
uses: actions/upload-artifact@v3

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
with:
4949
docker-image: "debian:${{ matrix.dist }}-slim"
5050
buildpackage-opts: --build=binary --no-sign
51+
extra-build-deps: git
5152

5253
- name: Upload deb files
5354
uses: actions/upload-artifact@v3

.github/workflows/smoke.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ jobs:
2323
with:
2424
fetch-depth: 0
2525

26-
- name: Get version
27-
id: get_version
28-
run: |
29-
echo "VERSION=$(git describe --tags)" >> $GITHUB_ENV
30-
echo ${{ env.VERSION }}
31-
3226
- name: Add 64-bit mingw-w64 to the PATH
3327
run: |
3428
echo "c:/msys64/bin;c:/msys64/mingw64/bin" >> $GITHUB_PATH
@@ -41,20 +35,21 @@ jobs:
4135
- name: run test
4236
run: |
4337
make test
44-
./cccc/cccc --version
4538
4639
windows:
4740
runs-on: windows-2019
4841

4942
steps:
5043
- uses: actions/checkout@v3
51-
with:
52-
fetch-depth: 0
44+
45+
- name: Git describe
46+
id: ghd
47+
uses: proudust/gh-describe@v1
5348

5449
- name: Enable Developer Command Prompt
5550
uses: ilammy/msvc-dev-cmd@v1
5651

5752
- name: Build
5853
run: |
59-
.\build_msvc.bat --version ${{ env.VERSION }}
54+
.\build_msvc.bat --version ${{ steps.ghd.outputs.describe }}
6055
.\cccc.exe --version

README.md renamed to README.rst

Lines changed: 57 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
README for CCCC versions 3.2.x
22
==============================
33

4-
[![Github CI](https://github.com/sarnold/cccc/actions/workflows/ci.yml/badge.svg)](https://github.com/sarnold/cccc/actions/workflows/ci.yml)
5-
[![Conda CI](https://github.com/sarnold/cccc/actions/workflows/conda.yml/badge.svg)](https://github.com/sarnold/cccc/actions/workflows/conda.yml)
6-
[![Debian packages](https://github.com/sarnold/cccc/actions/workflows/debs.yml/badge.svg)](https://github.com/sarnold/cccc/actions/workflows/debs.yml)
7-
[![Release CI](https://github.com/sarnold/cccc/actions/workflows/release.yml/badge.svg)](https://github.com/sarnold/cccc/actions/workflows/release.yml)
4+
|ci| |conda| |debs| |release|
85

9-
[![CCCC License](https://img.shields.io/badge/license-GPL2-green.svg?dummy)](https://github.com/sarnold/cccc/blob/master/cccc/COPYING)
10-
![GitHub tag (latest SemVer pre-release)](https://img.shields.io/github/v/tag/sarnold/cccc?include_prereleases)
11-
[![Github Issues](https://img.shields.io/github/issues/sarnold/cccc)](https://github.com/sarnold/cccc/issues?q=is:issue+is:open)
6+
|tag| |license| |issues|
127

13-
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/cccc.svg)](https://anaconda.org/conda-forge/cccc)
14-
[![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/cccc.svg)](https://anaconda.org/conda-forge/cccc)
8+
|vconda| |pconda|
9+
10+
What is it?
11+
-----------
1512

1613
This is a maintenance update of the last (sourceforge) release of the program
1714
CCCC (C and C++ Code Counter). This software performs analysis and reports
@@ -21,12 +18,22 @@ Ada95, which were supported in previous versions are presently not supported
2118
new site for CCCC development is: https://github.com/sarnold/cccc and for
2219
current documentation see: http://sarnold.github.io/cccc/
2320

24-
* [Github Action](https://github.com/marketplace/actions/cccc-action) - Now available as a github action!
25-
* [Quick Install](https://github.com/sarnold/cccc/blob/master/README_install.rst) - Quick start install instructions
26-
* [User Guide](http://sarnold.github.io/cccc/CCCC_User_Guide.html) - User guide (updated)
27-
* [Release Notes](https://github.com/sarnold/cccc/blob/master/CHANGELOG.md) - Autogenerated changelog for github releases (with a little SVN history for context)
28-
* [Software API docs](http://sarnold.github.io/cccc/api/html/index.html) - Software API documentation with design diagrams, etc
29-
* [Complexity Metrics](http://sarnold.github.io/cccc/metrics/cccc.html) - Source code metrics for a source code metrics tool... ;)
21+
* `Github Action`_ - Now available as a github action!
22+
* `Quick Install`_ - Quick start install instructions
23+
* `User Guide`_ - User guide (updated)
24+
* `Release Notes`_ - Autogenerated changelog for github releases (with a little SVN history for context)
25+
* `Software API docs`_ - Software API documentation with design diagrams, etc
26+
* `Complexity Metrics`_ - Source code metrics for a source code metrics tool... ;)
27+
28+
.. _Github Action: https://github.com/marketplace/actions/cccc-action
29+
.. _Quick Install: https://github.com/sarnold/cccc/blob/master/README_install.rst
30+
.. _User Guide: http://sarnold.github.io/cccc/CCCC_User_Guide.html
31+
.. _Release Notes: https://github.com/sarnold/cccc/blob/master/CHANGELOG.md
32+
.. _Software API docs: http://sarnold.github.io/cccc/api/html/index.html
33+
.. _Complexity Metrics: http://sarnold.github.io/cccc/metrics/cccc.html
34+
35+
Background
36+
----------
3037

3138
CCCC is a command line tool, originally implemented for Linux and other
3239
POSIX-style platforms, but also buildable on the Win32 platform. Files
@@ -67,6 +74,9 @@ to which you have and whether it is installed at the default position
6774
in the filesystem). On Linux and similar platforms the shell script
6875
build_posixgcc.sh should still work.
6976
77+
Historical
78+
----------
79+
7080
As of the last upstream release (ver 3.1.4) the reference build tool for the
7181
Win32 platform is the freely distributed Microsoft Visual C++ Toolkit 2003.
7282
As this toolkit does not contain a 'make' style program the script
@@ -125,7 +135,10 @@ domain with no restrictions, other than the pious hope that should anyone
125135
base a derivative work on it I will be given due credit. The current version
126136
is released under the GNU Public License (including the bundled PCCTS source).
127137

128-
The upcoming 3.1.5 release will be a maintenance release to clean up the build and
138+
Notes from the maintainer
139+
-------------------------
140+
141+
The initial 3.1.5 release was a maintenance release to clean up the build and
129142
makefile config (enabling parallel make) and fix a build error with recent gcc.
130143
The pccts build target "mini" builds only the tools required to build cccc,
131144
while the make target "pccts" builds the complete toolset, and "all" will build
@@ -137,10 +150,8 @@ of (expensive) commercial engineering tools. It has a simple CLI and other
137150
support like Jenkins plugins. Use it to find out your own complexity metrics.
138151
You might be surprised...
139152

140-
The above updates by Stephen L Arnold.
141-
142153
Notes from the original author
143-
==============================
154+
------------------------------
144155

145156
CCCC was originally developed as a proof-of-concept tool for some ideas
146157
relating to software metrics which I was investigating as an academic
@@ -169,13 +180,38 @@ available for the forseeable future from https://github.com/sarnold/cccc
169180
as well as the original home at http://cccc.sourceforge.net
170181

171182

183+
.. |ci| image:: https://github.com/sarnold/cccc/actions/workflows/ci.yml/badge.svg
184+
:target: https://github.com/sarnold/cccc/actions/workflows/ci.yml
185+
:alt: CI Status
172186

187+
.. |conda| image:: https://github.com/sarnold/cccc/actions/workflows/conda.yml/badge.svg
188+
:target: https://github.com/sarnold/cccc/actions/workflows/conda.yml
189+
:alt: Conda Status
173190

191+
.. |ci| image:: https://github.com/sarnold/cccc/actions/workflows/debs.yml/badge.svg
192+
:target: https://github.com/sarnold/cccc/actions/workflows/release.yml
193+
:alt: Debian packages
174194

195+
.. |release| image:: https://github.com/sarnold/cccc/actions/workflows/release.yml/badge.svg
196+
:target: https://github.com/sarnold/cccc/actions/workflows/release.yml
197+
:alt: Release Status
175198

199+
.. |license| image:: https://img.shields.io/badge/license-GPL2-green.svg?dummy
200+
:target: https://github.com/sarnold/cccc/blob/master/cccc/COPYING
201+
:alt: License
176202

203+
.. |tag| image:: https://img.shields.io/github/v/tag/sarnold/cccc?include_prereleases
204+
:target: https://github.com/sarnold/cccc/releases
205+
:alt: GitHub tag (latest SemVer pre-release)
177206

207+
.. |issues| image:: https://img.shields.io/github/issues/sarnold/cccc
208+
:target: https://github.com/sarnold/cccc/issues?q=is:issue+is:open
209+
:alt: Issues
178210

211+
.. |vconda| image:: https://img.shields.io/conda/vn/conda-forge/cccc.svg
212+
:target: https://anaconda.org/conda-forge/cccc
213+
:alt: Conda Version
179214

180-
181-
215+
.. |pconfa| image:: https://img.shields.io/conda/pn/conda-forge/cccc.svg
216+
:target: https://anaconda.org/conda-forge/cccc
217+
:alt: Conda Platforms

build_msvc.bat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ if "%arg1%"=="--clean" (
3232
for %%d in ( pccts\dlg pccts\antlr cccc ) do (
3333
if exist %%d\*.obj del %%d\*.obj
3434
if exist %%d\*.exe del %%d\*.exe
35-
if exist %%d\cccc_ver.h del %%d\cccc_ver.h
3635
)
3736
if exist pccts\bin rmdir /s /q pccts\bin
3837
mkdir pccts\bin

debian/docs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
README.md
1+
README.rst

debian/rules

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ CFLAGS += -c -I/usr/include/pccts -x c++
2222
buildflags := CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
2323

2424
override_dh_auto_build:
25-
$(MAKE) -C cccc -f rules.mak cccc_ver.h
2625
$(MAKE) -C cccc -f posixgcc.mak $(buildflags) \
27-
PCCTS_H=/usr/include/pccts PCCTS_BIN=/usr/bin $(CROSS)
26+
PCCTS_H=/usr/include/pccts PCCTS_BIN=/usr/bin $(CROSS) cccc
2827

2928
override_dh_auto_test:
3029
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))

0 commit comments

Comments
 (0)