diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 083cf97edbea7f39967d2b24e57d260220dea6a2..d0f266eee7686bc81389ec18a459f8ce20faa7b5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,58 +1,21 @@ -stages: # List of stages for jobs, and their order of execution - - build - - test - - deploy - -cache: &global_cache - # key: $CI_COMMIT_REF_SLUG - key: $CI_COMMIT_SHA - paths: - - bin - policy: pull-push - -build-job: # This job runs in the build stage, which runs first. - stage: build - tags: - - cloud - script: - - echo "Compiling the code..." - - echo "Compile complete." - - mkdir -p bin - - cp /usr/bin/rev bin - -unit-test-job: # This job runs in the test stage. - stage: test # It only starts when the job in the build stage completes successfully. - tags: - - cloud-gpu - cache: - # inherit all global cache settings - <<: *global_cache - # override the policy - policy: pull - script: - - echo "Running unit tests... This will take about 60 seconds." | bin/rev - -lint-test-job: # This job also runs in the test stage. - stage: test # It can run at the same time as unit-test-job (in parallel). - tags: - - cloud - cache: - # inherit all global cache settings - <<: *global_cache - # override the policy - policy: pull - script: - - echo "Linting code... This will take about 10 seconds." | bin/rev - -deploy-job: # This job runs in the deploy stage. - stage: deploy # It only runs when *both* jobs in the test stage complete successfully. - tags: - - cloud - cache: - # inherit all global cache settings - <<: *global_cache - # override the policy - policy: pull - script: - - echo "Deploying application..." - - echo "Application successfully deployed." | bin/rev +test_python_numpy: + image: python:3.9 + tags: - docker + cache: + key: "python39_pip_cache_20220731" + paths: + - .cache/pip + variables: + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" + before_script: + - pip install numpy==1.22.4 + script: + - > + python -c + " + import numpy as np + A = np.random.rand(32,32) + B = np.linalg.inv(A) + C = A @ B + assert(np.allclose(C.diagonal(), np.ones(32))) + "