16

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*
giraffe
  • 721
  • 3
  • 9
  • 25
  • 1
    That's odd. Are you sure there are files that fit the artifacts path? Can you show us the console output of the job in question? – Jawad Apr 22 '17 at 09:06

3 Answers3

28

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:
      - ...
Alexander Presber
  • 6,429
  • 2
  • 37
  • 66
2

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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

There can be several reasons for this not happening. Most likely the file was never generated and as such was not available as an artifact. You can find the cause of this in the output itself.

Artifact upload is always logged in the output as well, for instance this is some debug in a build of mine:

Uploading artifacts...
storage/logs/lumen.log: found 1 matching files     
Uploading artifacts to coordinator... ok            id=1444 responseStatus=201 Created token=MHYPxxWu

If you don't see anything like that, most likely the reason why is also logged.

Luceos
  • 6,629
  • 1
  • 35
  • 65