-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Programming exercises: Add typescript programming language template (#…
- Loading branch information
Showing
44 changed files
with
5,300 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ public enum ProgrammingLanguage { | |
R, | ||
RUST, | ||
SWIFT, | ||
TYPESCRIPT, | ||
VHDL, | ||
EMPTY | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
export AEOLUS_INITIAL_DIRECTORY=${PWD} | ||
install_dependencies () { | ||
echo '⚙️ executing install_dependencies' | ||
npm ci --prefer-offline --no-audit | ||
} | ||
|
||
build () { | ||
echo '⚙️ executing build' | ||
npm run build | ||
} | ||
|
||
test () { | ||
echo '⚙️ executing test' | ||
npm run test:ci | ||
} | ||
|
||
main () { | ||
if [[ "${1}" == "aeolus_sourcing" ]]; then | ||
return 0 # just source to use the methods in the subshell, no execution | ||
fi | ||
local _script_name | ||
_script_name=${BASH_SOURCE[0]:-$0} | ||
cd "${AEOLUS_INITIAL_DIRECTORY}" | ||
bash -c "source ${_script_name} aeolus_sourcing; install_dependencies" | ||
cd "${AEOLUS_INITIAL_DIRECTORY}" | ||
bash -c "source ${_script_name} aeolus_sourcing; build" | ||
cd "${AEOLUS_INITIAL_DIRECTORY}" | ||
bash -c "source ${_script_name} aeolus_sourcing; test" | ||
} | ||
|
||
main "${@}" |
16 changes: 16 additions & 0 deletions
16
src/main/resources/templates/aeolus/typescript/default.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
api: v0.0.1 | ||
metadata: | ||
name: TypeScript | ||
description: Run tests using Jest | ||
actions: | ||
- name: install_dependencies | ||
script: 'npm ci --prefer-offline --no-audit' | ||
- name: build | ||
script: 'npm run build' | ||
- name: test | ||
script: 'npm run test:ci' | ||
runAlways: false | ||
results: | ||
- name: junit | ||
path: 'junit.xml' | ||
type: junit |
62 changes: 62 additions & 0 deletions
62
src/main/resources/templates/jenkins/typescript/regularRuns/pipeline.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* This file configures the actual build steps for the automatic grading. | ||
* | ||
* !!! | ||
* For regular exercises, there is no need to make changes to this file. | ||
* Only this base configuration is actively supported by the Artemis maintainers | ||
* and/or your Artemis instance administrators. | ||
* !!! | ||
*/ | ||
|
||
dockerImage = '#dockerImage' | ||
dockerFlags = '#dockerArgs' | ||
|
||
/** | ||
* Main function called by Jenkins. | ||
*/ | ||
void testRunner() { | ||
docker.image(dockerImage).inside(dockerFlags) { c -> | ||
runTestSteps() | ||
} | ||
} | ||
|
||
private void runTestSteps() { | ||
test() | ||
} | ||
|
||
/** | ||
* Run unit tests | ||
*/ | ||
private void test() { | ||
stage('Install Dependencies') { | ||
sh 'npm ci --prefer-offline --no-audit' | ||
} | ||
stage('Build') { | ||
sh 'npm run build' | ||
} | ||
stage('Test') { | ||
sh 'npm run test:ci' | ||
} | ||
} | ||
|
||
/** | ||
* Script of the post build tasks aggregating all JUnit files in $WORKSPACE/results. | ||
* | ||
* Called by Jenkins. | ||
*/ | ||
void postBuildTasks() { | ||
sh ''' | ||
rm -rf results | ||
mkdir results | ||
if [ -e junit.xml ] | ||
then | ||
sed -i 's/<testsuites[^>]*>/<testsuite>/g ; s/<\\/testsuites>/<\\/testsuite>/g' junit.xml | ||
fi | ||
cp junit.xml $WORKSPACE/results/ || true | ||
sed -i 's/[^[:print:]\t]/�/g' $WORKSPACE/results/*.xml || true | ||
''' | ||
} | ||
|
||
// very important, do not remove | ||
// required so that Jenkins finds the methods defined in this script | ||
return this |
132 changes: 132 additions & 0 deletions
132
src/main/resources/templates/typescript/exercise/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
# NodeJS .gitignore from https://github.com/github/gitignore/blob/main/Node.gitignore | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
.pnpm-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Snowpack dependency directory (https://snowpack.dev/) | ||
web_modules/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional stylelint cache | ||
.stylelintcache | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variable files | ||
.env | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.env.local | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
.parcel-cache | ||
|
||
# Next.js build output | ||
.next | ||
out | ||
|
||
# Nuxt.js build / generate output | ||
.nuxt | ||
dist | ||
|
||
# Gatsby files | ||
.cache/ | ||
# Comment in the public line in if your project uses Gatsby and not Next.js | ||
# https://nextjs.org/blog/next-9-1#public-directory-support | ||
# public | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# vuepress v2.x temp and cache directory | ||
.temp | ||
.cache | ||
|
||
# Docusaurus cache and generated files | ||
.docusaurus | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# Stores VSCode versions used for testing VSCode extensions | ||
.vscode-test | ||
|
||
# yarn v2 | ||
.yarn/cache | ||
.yarn/unplugged | ||
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* |
Oops, something went wrong.