<commit_before>image: nitlang/nit-ci

cache:
  paths:
    - .ccache
  key: <KEY>"

stages:
  - build
  - test
  - more_test
  - deploy

before_script:
  - date
  - export CCACHE_DIR=$PWD/.ccache
  - export PATH=$PWD/bin:$PATH
  - pwd
  - ccache -s
  - ccache -M 500M
  - type -a nitc nitdoc || true # is there some nit tools?
  - "> status.txt"

after_script:
  - export CCACHE_DIR=$PWD/.ccache
  - ccache -s
  - git status --ignored
  - date
  - tail status.txt

# BASIC JOBS ########################################################

sanity_checks:
  stage: build
  script:
    - misc/jenkins/checkwhitespaces.sh | tee -a status.txt
    - misc/jenkins/checksignedoffby.sh | tee -a status.txt
    - misc/jenkins/checklicense.sh | tee -a status.txt

build_tools:
  stage: build
  script:
    - make 2>> status.txt
    - nitc --version
    - misc/jenkins/check_manpages.sh
    - "{ cd tests && ./tests.sh base_sim*.nit ../src/nitlight.nit; }"
    - nitunit -v lib/core
  artifacts:
    paths:
      - bin/*
      - c_src/nitc
      - src/version.nit
      - src/nitc_0
      - nitunit.xml*
      - tests/*.xml*
    when: always
    reports:
      junit:
        - tests/*.xml
        - nitunit.xml

test_some:
  stage: test
  dependencies:
    - build_tools
  script:
    - cd tests
    - ./search_tests_git.sh origin/master HEAD > list
    - ./testall.sh `cat list` | tee log.txt
    - grep -v '=>' log.txt > ../status.txt || true
  artifacts:
    paths:
      - tests/errlist
      - tests/*.xml
    when: always
    reports:
      junit: tests/*.xml

nitunit_some:
  stage: test
  dependencies:
    - build_tools
  script:
    - git diff --name-only origin/master..HEAD -- "*.nit" "*.res" "README.*" | grep -v "^tests/" > list0.txt
    - xargs nitls -pP < list0.txt > list.txt
    - xargs nitunit < list.txt
  artifacts:
    paths:
      - nitunit.xml*
    when: always
    reports:
      junit:
        - nitunit.xml

nitpick_full:
  stage: test
  dependencies:
    - build_tools
  script:
    - nitls lib src examples contrib
    - nitls -Pp lib src examples | grep -v -f tests/gitlab_ci.skip > list.txt # filter what is skipped by tests.sh
    - xargs nitpick < list.txt

# TEST FULL #########################################################

test_full_nitcs:
  stage: more_test
  dependencies:
    - build_tools
  script:
    - cd tests
    - ./testfull.sh | tee log.txt
    - grep -v '=>' log.txt > ../status.txt || true
  artifacts:
    paths:
      - tests/errlist
      - tests/*.xml*
      - tests/out/*.res
      - tests/out/*.log
    when: always
    reports:
      junit: tests/*.xml
<commit_msg>gitlab_ci: basic test for android<commit_after>image: nitlang/nit-ci

cache:
  paths:
    - .ccache
  key: "$CI_JOB_NAME"

stages:
  - build
  - test
  - more_test
  - deploy

before_script:
  - date
  - export CCACHE_DIR=$PWD/.ccache
  - export PATH=$PWD/bin:$PATH
  - pwd
  - ccache -s
  - ccache -M 500M
  - type -a nitc nitdoc || true # is there some nit tools?
  - "> status.txt"

after_script:
  - export CCACHE_DIR=$PWD/.ccache
  - ccache -s
  - git status --ignored
  - date
  - tail status.txt

# BASIC JOBS ########################################################

sanity_checks:
  stage: build
  script:
    - misc/jenkins/checkwhitespaces.sh | tee -a status.txt
    - misc/jenkins/checksignedoffby.sh | tee -a status.txt
    - misc/jenkins/checklicense.sh | tee -a status.txt

build_tools:
  stage: build
  script:
    - make 2>> status.txt
    - nitc --version
    - misc/jenkins/check_manpages.sh
    - "{ cd tests && ./tests.sh base_sim*.nit ../src/nitlight.nit; }"
    - nitunit -v lib/core
  artifacts:
    paths:
      - bin/*
      - c_src/nitc
      - src/version.nit
      - src/nitc_0
      - nitunit.xml*
      - tests/*.xml*
    when: always
    reports:
      junit:
        - tests/*.xml
        - nitunit.xml

test_some:
  stage: test
  dependencies:
    - build_tools
  script:
    - cd tests
    - ./search_tests_git.sh origin/master HEAD > list
    - ./testall.sh `cat list` | tee log.txt
    - grep -v '=>' log.txt > ../status.txt || true
  artifacts:
    paths:
      - tests/errlist
      - tests/*.xml
    when: always
    reports:
      junit: tests/*.xml

nitunit_some:
  stage: test
  dependencies:
    - build_tools
  script:
    - git diff --name-only origin/master..HEAD -- "*.nit" "*.res" "README.*" | grep -v "^tests/" > list0.txt
    - xargs nitls -pP < list0.txt > list.txt
    - xargs nitunit < list.txt
  artifacts:
    paths:
      - nitunit.xml*
    when: always
    reports:
      junit:
        - nitunit.xml

nitpick_full:
  stage: test
  dependencies:
    - build_tools
  script:
    - nitls lib src examples contrib
    - nitls -Pp lib src examples | grep -v -f tests/gitlab_ci.skip > list.txt # filter what is skipped by tests.sh
    - xargs nitpick < list.txt

basic_android:
  stage: test
  dependencies:
    - build_tools
  script:
    - make -C contrib/asteronits android
  artifacts:
    paths:
      - contrib/asteronits/bin/*.apk

# TEST FULL #########################################################

test_full_nitcs:
  stage: more_test
  dependencies:
    - build_tools
  script:
    - cd tests
    - ./testfull.sh | tee log.txt
    - grep -v '=>' log.txt > ../status.txt || true
  artifacts:
    paths:
      - tests/errlist
      - tests/*.xml*
      - tests/out/*.res
      - tests/out/*.log
    when: always
    reports:
      junit: tests/*.xml

{'fraction_non_alphanumeric': 0.16433050534857985, 'fraction_numerical': 0.0025820730357801547, 'mean_word_length': 2.038095238095238, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 20}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4574371', 'n_tokens_mistral': 1988, 'n_tokens_neox': 1916, 'n_words': 455}