This repository has been archived on 2023-02-02. You can view files and clone it, but cannot push or open issues or pull requests.
mfgames-nitride-cil/.gitlab-ci.yml

65 lines
2.1 KiB
YAML
Raw Normal View History

2021-11-18 07:36:13 +00:00
# Nix handling based on https://gitlab.com/Vonfry/gitlab-ci-nix/-/blob/master/.gitlab-ci.yml
2021-09-07 05:15:45 +00:00
stages:
- build
2021-11-18 07:59:56 +00:00
#- test
2021-11-18 07:36:13 +00:00
- release
variables:
GIT_SUBMODULE_STRATEGY: recursive
LOCAL_NIX_STORE: $CI_PROJECT_DIR/.nix/store
2021-09-07 05:15:45 +00:00
default:
2021-11-18 07:36:13 +00:00
image: nixos/nix:latest
2021-09-07 05:15:45 +00:00
before_script:
2021-11-18 07:36:13 +00:00
- "[ -f $LOCAL_NIX_STORE ] && nix-store --import < $LOCAL_NIX_STORE"
after_script:
- "[ ! -d $(dirname \"$LOCAL_NIX_STORE\") ] && mkdir -p $LOCAL_NIX_STORE"
- "[ -h ./result ] && nix-store --export $(nix-store --query --requisites --include-outputs ./result) > $LOCAL_NIX_STORE"
cache:
paths:
- .nix/
2021-09-07 05:15:45 +00:00
build:
stage: build
script:
- nix-shell --run "npm install --ci"
2021-11-18 07:36:13 +00:00
- nix-shell --run "npx commitlint-gitlab-ci -x @commitlint/config-conventional"
- nix-shell --run "npm run build"
rules:
- if: $CI_COMMIT_BRANCH
2021-09-07 05:15:45 +00:00
2021-11-18 07:59:56 +00:00
#test:
# stage: test
# script:
# - nix-shell --run "npm run test"
# # Testing is currently not working.
# #- 'dotnet test --test-adapter-path:. --logger:"junit;LogFilePath=../artifacts/{assembly}-test-result.xml;MethodFormat=Default;FailureBodyFormat=Verbose" --collect:"XPlat Code Coverage"'
#
# # Summarize the output for Gitlab CI reporting.
# #- dotnet new tool-manifest
# #- dotnet tool install dotnet-reportgenerator-globaltool
# #- dotnet tool run reportgenerator -reports:src/*/TestResults/*/coverage.cobertura.xml -targetdir:./coverage "-reporttypes:Cobertura;TextSummary"
# #- grep "Line coverage" coverage/Summary.txt
# artifacts:
# when: always
# paths:
# - ./**/*test-result.xml
# - ./coverage/Cobertura.xml
# - ./coverage/Summary.*
# - ./**/*.nupkg
# reports:
# junit:
# - ./**/*test-result.xml
# cobertura:
# - ./coverage/Cobertura.xml
2021-11-18 07:36:13 +00:00
publish:
stage: release
script:
2021-11-18 07:59:56 +00:00
- nix-shell --run "npm install --ci"
2021-11-18 08:15:09 +00:00
- nix-shell --run "npm run build"
2021-11-18 08:08:23 +00:00
- nix-shell --run "npx semantic-release"
2021-11-18 07:36:13 +00:00
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH