Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ARG DOCKER_OS=debian:bookworm

FROM $DOCKER_OS

COPY scripts/container.setup.sh /tmp/container.setup.sh

RUN --mount=type=cache,target=/var/cache/apt <<EOS
/tmp/container.setup.sh
EOS
24 changes: 24 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
{
"name": "FileOp",
"image": "mcr.microsoft.com/devcontainers/base:bookworm",
"postCreateCommand": "sudo ./scripts/container.setup.sh",
"customizations": {
"vscode": {
// cspell:disable
"extensions": [
"seunlanlege.action-buttons",
"streetsidesoftware.code-spell-checker",
"ms-vscode.cpptools"
]
// cspell:enable
}
}
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
97 changes: 78 additions & 19 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,16 @@ jobs:
apt update
apt install -y git
- uses: actions/checkout@v4

- name: Install build tools
run: |
./scripts/container.setup.sh

- name: Configure
run: |
git config --global --add safe.directory $PWD
./scripts/cmake.configure.sh -DCMAKE_BUILD_TYPE=${{ matrix.BuildType }}

- name: Build
run:
./scripts/cmake.build.sh
Expand Down Expand Up @@ -88,12 +93,20 @@ jobs:
run: choco install ninja
- name: Install gcovr
if: ${{ matrix.BuildType == 'Profile' }}
run: pip install git+https://github.com/gcovr/gcovr.git # gcovr==8.3
run: pip install gcovr==8.3

- name: Configure
run: ./scripts/cmake.configure.sh -DCMAKE_BUILD_TYPE=${{ matrix.BuildType }}

- name: Build
run: ./scripts/cmake.build.sh
- name: Upload FileOp.7z
if: always()
uses: actions/upload-artifact@v4
with:
name: app-windows${{ matrix.BuildType == 'Profile' && '-profile' || ''}}
path: build/FileOp.7z

- name: Test
run: |
./scripts/cmake.test.sh || ExitCode=$?
Expand All @@ -104,6 +117,12 @@ jobs:
- name: Run performance test
if: always()
run: ./scripts/run_test_performance.sh 2>&1 | tee performance.txt
- name: Upload performance report
if: ${{ matrix.BuildType == 'Release' && always() }}
uses: actions/upload-artifact@v4
with:
name: performance
path: performance.txt

- name: Create coverage report
if: ${{ matrix.BuildType == 'Profile' && always() }}
Expand All @@ -112,7 +131,6 @@ jobs:
--filter src/ \
--exclude-noncode-lines build \
--txt coverage.txt \
--markdown coverage.md --markdown-title "Test coverage report" --markdown-file-link 'https://github.com/Spacetown/FileOp/blob/${{ github.sha }}/{file}' \
--json coverage.json --json-pretty \
--html-single-page --html-title "GCOVR report for $(git rev-parse HEAD)" --html-details coverage.html
cat coverage.txt
Expand All @@ -124,32 +142,30 @@ jobs:
name: coverage
path: coverage.*

- name: Upload ZIP
if: always()
uses: actions/upload-artifact@v4
with:
name: app-windows${{ matrix.BuildType == 'Profile' && '-profile' || ''}}
path: build/FileOp.7z

- name: Add job summary
if: ${{ matrix.BuildType == 'Profile' && always() }}
run: |
(
cat coverage.md
echo ""
cat performance.txt
) >> $GITHUB_STEP_SUMMARY

deploy:
needs:
- container-build
- build
runs-on: Windows-latest
permissions:
contents: write
steps:
- name: Download artifacts
- uses: actions/checkout@v4
- name: Set up environment
run: |
echo "FILEOP_VERSION=$(scripts/get_version.sh)" >> $GITHUB_ENV
- name: Download apps
uses: actions/download-artifact@v4
with:
pattern: app-*
- name: Download coverage report
uses: actions/download-artifact@v4
with:
name: coverage
- name: Download performance report
uses: actions/download-artifact@v4
with:
name: performance
# cspell:ignore oapp
- name: Test container release build
run: |
Expand All @@ -163,3 +179,46 @@ jobs:
run: |
7z x -oapp-windows-profile app-windows-profile/FileOp.7z
./app-windows-profile/FileOp.exe --help

- name: Create release notes
run: |
sed -n '/^## / { p; :a; n; /^## /q; p; ba; }' Changelog.md | sed -e 's/^## /# /;' > release_notes.md

- name: Add job summary
run: |
(
cat release_notes.md
echo ""
echo "# Test coverage report"
echo ""
echo '```'
cat coverage.txt
echo '```'
echo ""
cat performance.txt
) >> $GITHUB_STEP_SUMMARY

- name: Create new tag
run: |
# Set git user info
git config --global user.email "noreply@zf.com"
git config --global user.name "FileOp authors"

# Create the tag and print the output.
sed -e "/^# / { s/^# //; s/$/ $(date -I)/; }" release_notes.md | tee commit_msg.txt
git tag -a "$FILEOP_VERSION" -F commit_msg.txt
git tag --list -n "$FILEOP_VERSION"

- name: Push new tag
if: ${{ (github.repository == 'ZF-Group/FileOp') && (github.event.ref == 'refs/heads/main') && (env.FILEOP_VERSION != '0.0.0') }}
run: |
git push origin "refs/tags/$FILEOP_VERSION"

- name: Create release and upload build artifacts
if: ${{ (github.repository == 'ZF-Group/FileOp') && (github.event.ref == 'refs/heads/main') && (env.FILEOP_VERSION != '0.0.0') }}
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
with:
tag_name: ${{ env.FILEOP_VERSION }}
body_path: release_notes.md
files: ./app-windows/FileOp.exe

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/.venv/
/build/
/dockcross
4 changes: 2 additions & 2 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

<!-- cspell:ignore INFDTEP -->

## Unreleased
## 1.9.0

- First release under BSD 3-Clause License.
- Use CMake and cross compiling with gcc-11.
- Use CMake and cross compiling with mingw-w64 to be able to build on all systems running Docker.

## 1.8.0

Expand Down
13 changes: 4 additions & 9 deletions FileOp.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,19 @@
"settings": {
"actionButtons": {
"commands": [
{
"name": "Setup env",
"command": "docker run --rm --platform linux/amd64 dockcross/windows-static-x64 > ./dockcross && chmod +x ./dockcross",
"singleInstance": true
},
{
"name": "Configure (Profile)",
"command": "./dockcross --args '--platform linux/amd64' bash -c './scripts/cmake.configure.sh -DCMAKE_BUILD_TYPE=Profile'",
"command": "./scripts/cmake.configure.sh -DCMAKE_BUILD_TYPE=Profile",
"singleInstance": true
},
{
"name": "Configure (Release)",
"command": "./dockcross --args '--platform linux/amd64' bash -c './scripts/cmake.configure.sh -DCMAKE_BUILD_TYPE=Release'",
"command": "./scripts/cmake.configure.sh -DCMAKE_BUILD_TYPE=Release",
"singleInstance": true
},
{
"name": "Build",
"command": "./dockcross --args '--platform linux/amd64' bash -c './scripts/cmake.build.sh'",
"command": "./scripts/cmake.build.sh",
"singleInstance": true
}
],
Expand All @@ -40,7 +35,7 @@
"seunlanlege.action-buttons",
"streetsidesoftware.code-spell-checker",
"EditorConfig.EditorConfig",
"ms-vscode.cpptools-extension-pack"
"ms-vscode.cpptools"
]
// cspell:enable
}
Expand Down
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

[![Run FileOp CI](https://github.com/ZF-Group/FileOp/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/ZF-Group/FileOp/actions/workflows/CI.yml)

# FileOp

Tool for general file operations under Windows with support of file names longer than MAX_PATH (260 characters).
Expand All @@ -9,19 +11,24 @@ Windows command line tools only support paths with a maximum length of 260 chara
As workaround you need to subst the directory to a drive letter and delete the sub
tree from there.

## Directory layout
## Usage

dir | description
--- | ---
`build` | *ignored*: Storage of build-results
`src` | Storage for source files
`tests` | Storage for test scripts
All supported commands are compiled into a single executable `FileOp.exe`. To get a list of commands
and the available options you can execute `FileOp.exe --help`.

## Development

For development a workspace for `Visual Studio Code` is configured together with a cross compiler
running under docker.

## Directory layout

| dir | description |
| --------- | ----------------------------------- |
| `build` | *ignored*: Storage of build results |
| `scripts` | Storage for source files |
| `src` | Storage for source files |

### Build

The project uses CMake and ninja for building the executable. The CMake configuration step is executed by
Expand All @@ -31,4 +38,4 @@ execute the tools.

### Test

To test the generated artifacts call `.\tools\test.cmd` or use `Terminal`->`Run Task...`->`Test` in the IDE.
The test are also written in CMake and executed by calling [scripts/cmake.test.sh](./scripts/cmake.test.sh).
105 changes: 53 additions & 52 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,53 @@
{
"version": "0.2",
"files": [
"/**"
],
"ignorePaths": [
"/.git/",
"src/mingw-unicode.c"
],
"dictionaryDefinitions": [],
"dictionaries": [],
"enableGlobDot": true,
"words": [
"choco",
"devcontainers",
"dockcross",
"endgroup",
"fileop",
"gcov",
"gcovr",
"mapfile",
"mklink",
"msys",
"noncode",
"popd",
"pushd",
"STREQUAL",
"venv",
"windres"
],
"ignoreWords": [
"WINXP",
"endforeach",
"endfunction",
"noninteractive",
"operationcopy",
"seunlanlege"
],
"ignoreRegExpList": [
// GH actions
"uses: [^\\s]+/[^\\s]+@[^\\s]+",
// Options
"--[a-z0-9-]+",
// CMAKE and GCC defines
"-DCMAKE[A-Z_]*",
"-DN?DEBUG",
// Functions
"tcs[a-z]+",
"[a-z]+printf"
],
"import": []
}
{
"version": "0.2",
"files": [
"/**"
],
"ignorePaths": [
"/.git/",
"src/mingw-unicode.c"
],
"dictionaryDefinitions": [],
"dictionaries": [],
"enableGlobDot": true,
"words": [
"choco",
"cpptools",
"devcontainers",
"dockcross",
"endgroup",
"fileop",
"gcov",
"gcovr",
"mapfile",
"mklink",
"msys",
"noncode",
"popd",
"pushd",
"STREQUAL",
"venv",
"windres"
],
"ignoreWords": [
"WINXP",
"endforeach",
"endfunction",
"noninteractive",
"operationcopy",
"seunlanlege"
],
"ignoreRegExpList": [
// GH actions
"uses: [^\\s]+/[^\\s]+@[^\\s]+",
// Options
"--[a-z0-9-]+",
// CMAKE and GCC defines
"-DCMAKE[A-Z_]*",
"-DN?DEBUG",
// Functions
"tcs[a-z]+",
"[a-z]+printf"
],
"import": []
}
Loading