diff --git a/generators/ci-cd/generator.mjs b/generators/ci-cd/generator.mjs index 12bae9c30..03f4a4bc0 100644 --- a/generators/ci-cd/generator.mjs +++ b/generators/ci-cd/generator.mjs @@ -70,6 +70,10 @@ export default class extends CiCdGenerator { condition: ctx => ctx.ciType === GITHUB, templates: ['.github/workflows/dotnet.yml'] }, + { + condition: ctx => ctx.ciType === GITLAB, + templates: ['.gitlab-ci.yml'] + }, ], }, context: this, diff --git a/generators/ci-cd/templates/.gitlab-ci.yml.ejs b/generators/ci-cd/templates/.gitlab-ci.yml.ejs new file mode 100644 index 000000000..039cab873 --- /dev/null +++ b/generators/ci-cd/templates/.gitlab-ci.yml.ejs @@ -0,0 +1,18 @@ +image: mcr.microsoft.com/dotnet/sdk:6.0 + +before_script: + - dotnet --info + - curl -sL https://deb.nodesource.com/setup_12.x | bash - + - apt-get install -y nodejs + - node --version + - dotnet restore + +build: + stage: build + script: + - dotnet build --no-restore + +tests: + stage: test + script: + - dotnet test --no-restore