ci: updating Nix elements

This commit is contained in:
Dylan R. E. Moonfire 2021-11-18 01:59:56 -06:00
parent b48d2b22cb
commit 0e050445aa
2 changed files with 28 additions and 27 deletions

View file

@ -1,7 +1,7 @@
# Nix handling based on https://gitlab.com/Vonfry/gitlab-ci-nix/-/blob/master/.gitlab-ci.yml # Nix handling based on https://gitlab.com/Vonfry/gitlab-ci-nix/-/blob/master/.gitlab-ci.yml
stages: stages:
- build - build
- test #- test
- release - release
variables: variables:
@ -11,8 +11,6 @@ variables:
default: default:
image: nixos/nix:latest image: nixos/nix:latest
before_script: before_script:
- nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
- nix-channel --update
- "[ -f $LOCAL_NIX_STORE ] && nix-store --import < $LOCAL_NIX_STORE" - "[ -f $LOCAL_NIX_STORE ] && nix-store --import < $LOCAL_NIX_STORE"
after_script: after_script:
- "[ ! -d $(dirname \"$LOCAL_NIX_STORE\") ] && mkdir -p $LOCAL_NIX_STORE" - "[ ! -d $(dirname \"$LOCAL_NIX_STORE\") ] && mkdir -p $LOCAL_NIX_STORE"
@ -31,34 +29,36 @@ build:
rules: rules:
- if: $CI_COMMIT_BRANCH - if: $CI_COMMIT_BRANCH
test: #test:
stage: test # stage: test
script: # script:
- nix-shell --run "npm run test" # - nix-shell --run "npm run test"
# Testing is currently not working. # # 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"' # #- '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. # # Summarize the output for Gitlab CI reporting.
#- dotnet new tool-manifest # #- dotnet new tool-manifest
#- dotnet tool install dotnet-reportgenerator-globaltool # #- dotnet tool install dotnet-reportgenerator-globaltool
#- dotnet tool run reportgenerator -reports:src/*/TestResults/*/coverage.cobertura.xml -targetdir:./coverage "-reporttypes:Cobertura;TextSummary" # #- dotnet tool run reportgenerator -reports:src/*/TestResults/*/coverage.cobertura.xml -targetdir:./coverage "-reporttypes:Cobertura;TextSummary"
#- grep "Line coverage" coverage/Summary.txt # #- grep "Line coverage" coverage/Summary.txt
artifacts: # artifacts:
when: always # when: always
paths: # paths:
- ./**/*test-result.xml # - ./**/*test-result.xml
- ./coverage/Cobertura.xml # - ./coverage/Cobertura.xml
- ./coverage/Summary.* # - ./coverage/Summary.*
- ./**/*.nupkg # - ./**/*.nupkg
reports: # reports:
junit: # junit:
- ./**/*test-result.xml # - ./**/*test-result.xml
cobertura: # cobertura:
- ./coverage/Cobertura.xml # - ./coverage/Cobertura.xml
publish: publish:
stage: release stage: release
script: script:
- nix-shell --run "npm install --ci"
- nix-shell --run "npm run build"
- nix-shell --run "npm run semantic-release" - nix-shell --run "npm run semantic-release"
rules: rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

View file

@ -4,6 +4,7 @@ let
in in
pkgs.mkShell { pkgs.mkShell {
buildInputs = [ buildInputs = [
pkgs.git
pkgs.nodejs-16_x pkgs.nodejs-16_x
pkgs.yarn pkgs.yarn
pkgs.dotnet-sdk_5 pkgs.dotnet-sdk_5