CI: Move single checks to Github, remove dead code
Remove support for very old frontend - we were not testing it anyways.
Move the useful checks to another job so they run once.
1 parent 9df5f71 commit a2a05930bf783e9a4b520865159add2befba4b8d
@Mathias Lang Mathias Lang authored on 23 Jan 2024
Mathias LANG committed on 23 Jan 2024
Showing 7 changed files
View
22
.github/workflows/main.yml
# Use this branch name in your fork to test changes
- github-actions
 
jobs:
single_checks:
name: "Single sanity check"
runs-on: ubuntu-latest
steps:
- name: Install latest DMD
uses: dlang-community/setup-dlang@v1
- name: Checkout
uses: actions/checkout@v3
- name: Run tests
run: |
# check for trailing whitespace
TRAILING_WS_COUNT=$(find . -type f -name '*.d' -exec grep -Hn "[[:blank:]]$" {} \; | wc -l)
if [ $TRAILING_WS_COUNT -ne 0 ]; then
echo "========================================"
find . -type f -name '*.d' -exec grep -Hn "[[:blank:]]$" {} \;
echo "========================================"
echo "The files above have trailing whitespace"
exit 1
fi
# check that the man page generation still works
dub --single -v scripts/man/gen_man.d
 
main:
name: Run
strategy:
# Default, disable if you want to debug
View
27
scripts/ci/ci.sh
DUB=`pwd`/bin/dub DC=${DC} dub --single ./test/run-unittest.d
DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
fi
## Checks that only need to be done once per CI run
## Here the `COVERAGE` variable is abused for this purpose,
## as it's only defined once in the whole Travis matrix
if [ "$COVERAGE" = true ]; then
# run tests with different compilers
DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
clean
 
export FRONTEND=2.077
source $(~/dlang/install.sh ldc-1.7.0 --activate)
DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
deactivate
clean
 
export FRONTEND=2.068
source $(~/dlang/install.sh gdc-4.8.5 --activate)
DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
deactivate
 
# check for trailing whitespace
find . -type f -name '*.d' -exec grep -Hn "[[:blank:]]$" {} \;
# check that the man page generation still works
source $(~/dlang/install.sh dmd --activate)
source $(~/dlang/install.sh dub --activate)
dub --single -v scripts/man/gen_man.d
fi
View
6
scripts/man/gen_man.d
manFile.writeDefinition(manFile.specialLinkMainCmd(cmd.name), cmd.helpText.join(
manFile.mode == ManWriter.Mode.markdown ? "\n\n" : "\n"
));
}
}
}
 
 
 
writeln(manFile.header("COMMON OPTIONS"));
manFile.writeArgs("-", args);
}
View
2
■■■
source/dub/internal/tinyendian.d
[0x00, 0x00, 0xFE, 0xFF] ];
static immutable Endian[5] bomEndian = [ endian,
Endian.littleEndian,
Endian.bigEndian,
Endian.littleEndian,
Endian.littleEndian,
Endian.bigEndian ];
 
// Documented in function ddoc.
 
View
16
test/environment-variables.script.d
// postGenerateCommands uses system.environments < settings.environments < deppkg.environments < root.environments < deppkg.postGenerateEnvironments < root.postGenerateEnvironments
// preRunCommands uses system.environments < settings.environments < deppkg.environments < root.environments < deppkg.runEnvironments < root.runEnvironments < deppkg.preRunEnvironments < root.preRunEnvironments
// User application uses system.environments < settings.environments < deppkg.environments < root.environments < deppkg.runEnvironments < root.runEnvironments
// postRunCommands uses system.environments < settings.environments < deppkg.environments < root.environments < deppkg.runEnvironments < root.runEnvironments < deppkg.postRunEnvironments < root.postRunEnvironments
 
// Test cases covers:
// preGenerateCommands [in root]
// priority check: system.environments < settings.environments
// priority check: settings.environments < deppkg.environments
"VAR5": "system.VAR5"
], Config.none, size_t.max, currDir.buildPath("environment-variables"));
scope (failure)
writeln("environment-variables test failed... Testing stdout is:\n-----\n", res.output);
 
// preGenerateCommands [in root]
assert(res.output.canFind("root.preGenerate: setting.PRIORITYCHECK_SYS_SET"), "preGenerate environment variables priority check is failed.");
assert(res.output.canFind("root.preGenerate: deppkg.PRIORITYCHECK_SET_DEP"), "preGenerate environment variables priority check is failed.");
assert(res.output.canFind("root.preGenerate: deppkg.PRIORITYCHECK_DEP_ROOT"), "preGenerate environment variables priority check is failed.");
assert(res.output.canFind("root.preGenerate: deppkg.PRIORITYCHECK_ROOT_DEPSPEC"), "preGenerate environment variables priority check is failed.");
assert(res.output.canFind("root.preGenerate: root.PRIORITYCHECK_DEPSPEC_ROOTSPEC"), "preGenerate environment variables priority check is failed.");
 
// postGenerateCommands [in root]
assert(res.output.canFind("root.postGenerate: deppkg.VAR4", "postGenerate environment variables expantion check is failed."));
 
// preBuildCommands [in deppkg]
assert(res.output.canFind("deppkg.preBuild: deppkg.PRIORITYCHECK_ROOT_DEPBLDSPEC"), "preBuild environment variables priority check is failed.");
assert(res.output.canFind("deppkg.preBuild: root.PRIORITYCHECK_DEPBLDSPEC_ROOTBLDSPEC"), "preBuild environment variables priority check is failed.");
assert(res.output.canFind("deppkg.preBuild: deppkg.PRIORITYCHECK_ROOTBLDSPEC_DEPSPEC"), "preBuild environment variables priority check is failed.");
assert(res.output.canFind("deppkg.preBuild: root.PRIORITYCHECK_DEPSPEC_ROOTSPEC"), "preBuild environment variables priority check is failed.");
 
// postBuildCommands [in deppkg]
assert(res.output.canFind("deppkg.postBuild: deppkg.VAR4"), "postBuild environment variables expantion check is failed.");
 
// preRunCommands [in deppkg][in root]
assert(!res.output.canFind("deppkg.preRun: deppkg.VAR4"), "preRun that is defined dependent library does not call.");
assert(res.output.canFind("root.preRun: deppkg.VAR4"), "preRun environment variables expantion check is failed.");
 
// Application run
assert(res.output.canFind("app.run: root.VAR1"), "run environment variables expantion check is failed.");
assert(res.output.canFind("app.run: settings.VAR2"), "run environment variables expantion check is failed.");
assert(res.output.canFind("app.run: root.VAR3"), "run environment variables expantion check is failed.");
assert(res.output.canFind("app.run: deppkg.VAR4"), "run environment variables expantion check is failed.");
assert(res.output.canFind("app.run: system.VAR5"), "run environment variables expantion check is failed.");
assert(res.output.canFind("app.run: system.SYSENVVAREXPCHECK"), "run environment variables expantion check is failed.");
 
// postRunCommands [in deppkg][in root]
assert(!res.output.canFind("deppkg.postRun: deppkg.VAR4"), "postRunCommands that is defined dependent library does not call.");
assert(res.output.canFind("root.postRun: deppkg.VAR4"), "postRun environment variables expantion check is failed.");
}
View
3
■■
test/issue1504-envvar-in-path/source/app.d
pragma(msg, import("message.txt"));
 
void main()
{
{
}
View
5
test/issue2051_running_unittests_from_dub_single_file_packages_fails.d
{
auto dub = environment.get("DUB");
if (!dub.length)
dub = buildPath(".", "bin", "dub");
 
string destinationDirectory = tempDir;
// remove any ending slahes (which can for some reason be added at the end by tempDir, which fails on OSX) https://issues.dlang.org/show_bug.cgi?id=22738
destinationDirectory = buildNormalizedPath(destinationDirectory);
 
string filename;
// check if the single file package with dependency compiles and runs
{
filename = destinationDirectory.buildPath("issue2051_success.d");
writeln("\nError. Unittest passed.");
 
return rc1 | !rc2;
}