Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can’t find my artifacts with GitLab CI

I'm using a shared runner, on gitlab.com. The guide here shows a section for job artifacts. But when I run my job and look at my job page, I just see this:

screenshot of GitLab CI

There's no section for job artifacts.

What should I try?

Here's my .gitlab-ci.yml:

image: node:7.9

stages:
  - lint
  - test

cache:
  paths:
    - node_modules/

before_script:
  - npm install
  - npm install -g grunt-cli

lint:
  stage: lint
  script:
    - grunt lint

test:
  stage: test
  script:
    - grunt
    - grunt test
    - grunt coveralls
  artifacts:
    paths:
      - dist/project*.min.js*
like image 379
giraffe Avatar asked Apr 20 '17 19:04

giraffe


2 Answers

Are your artifacts created in failing test runs (e.g. screenshots when a test fails)?

If so, you have to take into account, that artifacts in Gitlab are as a default only collected for successful tests.

You have to explicitly configure Gitlab CI to always collect them, e.g.

test:
  ...
  artifacts:
    when: always
    paths:
      - ...
like image 175
Alexander Presber Avatar answered Nov 11 '22 17:11

Alexander Presber


There is another reason for which you would not find your artifact, with GitLab 13.8 (January 2021):

Project configuration to control storage of latest artifacts

Keeping the latest artifact from the most recent successful job is a useful default behavior but can also result in significant amounts of storage usage.
This can cause an unexpected surge in disk space usage if you have pipelines that generate large artifacts.

To improve storage consumption management, you can now disable this behavior for any project in the settings.

Coming up next, gitlab#276583 will allow you to entirely disable keeping the latest artifacts at the instance level.

https://about.gitlab.com/images/13_8/keep_latest_artifact_project_setting.png -- Project configuration to control storage of latest artifacts

See Documentation and Issue.

So If you don't have selected that option, there would be no artifact for you to find.

like image 42
VonC Avatar answered Nov 11 '22 16:11

VonC