diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 01fe8ae8d..ce6998907 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,22 +15,22 @@ variables: AWS_SHARED_CREDENTIALS_FILE: "/etc/aws/credentials" TRANSFER_METER_FREQUENCY: "2s" - # docker + # Docker ENV_USER: fradrive-env - # backend + # Backend STACK_ROOT: "${CI_PROJECT_DIR}/.stack" default: image: - name: registry.uniworx.de/fradrive/fradrive/fradrive-env:latest # bookworm + name: registry.uniworx.de/fradrive/fradrive/fradrive-env:latest # Debian 12.5 Bookworm entrypoint: [""] docker: platform: x86_64 user: ${ENV_USER} before_script: - - chown -R ${ENV_USER} . # change project directory ownership to (non-root) user inside docker container + - chown -R ${ENV_USER} . # Change project directory ownership to (non-root) user inside docker container artifacts: name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}" expire_in: "1 day" @@ -40,8 +40,8 @@ default: stages: - setup - - lint - build + - lint - test - container - prepare release @@ -92,28 +92,6 @@ backend dependencies: paths: - .stack -frontend lint: - stage: lint - script: - - make frontend-lint - cache: - - *frontend-cache - needs: - - job: frontend dependencies - artifacts: true - - job: well-known - artifacts: true - -backend lint: - stage: lint - cache: - - *stack-cache - script: - - make backend-lint-prod - needs: - - job: backend dependencies - artifacts: true - frontend build: stage: build cache: @@ -132,8 +110,7 @@ frontend build: - static/ - config/webpack.yml -# TODO rename to uniworx? -backend build: +uniworx: stage: build cache: - *stack-cache @@ -164,6 +141,7 @@ uniworxdb: script: - make bin/uniworxdb needs: + # TODO: no frontend needed - job: frontend dependencies # transitive artifacts: false - job: frontend build # transitive @@ -172,6 +150,7 @@ uniworxdb: paths: - bin/uniworxdb +# TODO: rewrite uniworx:exe:uniworxload: stage: build script: @@ -187,17 +166,30 @@ uniworx:exe:uniworxload: paths: - uniworx:exe:uniworxload.nar.xz -# check: -# stage: test -# script: -# - xzcat frontend.nar.xz | nix-store --import -# - xzcat uniworx:lib:uniworx.nar.xz | nix-store --import -# - nix -L flake check . -# needs: -# - job: frontend dependencies # transitive -# artifacts: false -# - job: frontend build -# artifacts: true +frontend lint: + stage: lint + script: + - make frontend-lint + cache: + - *frontend-cache + needs: + - job: frontend dependencies + artifacts: true + - job: well-known # TODO: is this really needed? + artifacts: true + +backend lint: + stage: lint + cache: + - *stack-cache + script: + # TODO: - make backend-lint-dev + - make backend-lint-prod + needs: + - job: backend dependencies + artifacts: true + - job: uniworx + artifacts: true frontend test: stage: test @@ -207,16 +199,22 @@ frontend test: needs: - job: frontend dependencies artifacts: true + # TODO: configure report artifacts backend test: stage: test script: - - "nix shell .#gnumake .#stack --command make backend-test" + - make backend-test-prod cache: *stack-cache needs: - job: backend dependencies artifacts: true + - job: uniworx + artifacts: true + # TODO: configure report artifacts +# TODO: unify prod and test versions +# TODO: rewrite container: stage: container script: @@ -236,6 +234,7 @@ container: - uniworx.tar.gz rules: &release-rules - if: $CI_COMMIT_TAG =~ /^v/ +# TODO: rewrite test container: stage: container script: @@ -256,6 +255,8 @@ test container: rules: &test-release-rules - if: $CI_COMMIT_TAG =~ /^t/ +# TODO: unify prod and test versions +# TODO: rewrite parse changelog: stage: prepare release needs: @@ -275,6 +276,7 @@ parse changelog: - .current-changelog.md name: "changelog-${CI_COMMIT_SHORT_SHA}" expire_in: "1 day" +# TODO: rewrite parse test changelog: stage: prepare release needs: @@ -294,6 +296,8 @@ parse test changelog: - .current-changelog.md name: "changelog-${CI_COMMIT_SHORT_SHA}" +# TODO: unify prod and test versions +# TODO: rewrite upload container: variables: GIT_STRATEGY: none @@ -316,6 +320,7 @@ upload container: - job: backend test # sanity artifacts: false rules: *release-rules +# TODO: rewrite upload test container: variables: GIT_STRATEGY: none @@ -339,6 +344,8 @@ upload test container: artifacts: false rules: *test-release-rules +# TODO: unify prod and test versions +# TODO: rewrite release: variables: GIT_STRATEGY: none @@ -359,6 +366,7 @@ release: - job: parse changelog artifacts: true retry: 0 +# TODO: rewrite test release: variables: GIT_STRATEGY: none