uktrade/aioftps3

View on GitHub
.circleci/config.yml

Summary

Maintainability
Test Coverage
version: 2
jobs:
  build:
    docker:
      - image: python:3.10.12
      - image: minio/minio:RELEASE.2018-11-22T02-51-56Z
        environment:
          MINIO_ACCESS_KEY: AKIAIOSFODNN7EXAMPLE
          MINIO_SECRET_KEY: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
          MINIO_REGION: us-east-1
        entrypoint: sh
        command: >
          -c
          "
            apk add --no-cache \\
              openssl=1.0.2t-r0 &&
            mkdir -p /root/.minio/certs &&
            mkdir -p /test-data/my-bucket &&
            mkdir -p /test-data/my-bucket-acme &&

            openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 -subj /CN=selfsigned \\
              -keyout /root/.minio/certs/private.key \\
              -out /root/.minio/certs/public.crt &&

            openssl genrsa 4096 > /test-data/my-bucket-acme/account.key &&
            openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 -subj /CN=selfsigned \\
              -keyout /test-data/my-bucket-acme/127.0.0.1.key \\
              -out /test-data/my-bucket-acme/127.0.0.1.crt &&

            openssl req -new -sha256 -key /test-data/my-bucket-acme/127.0.0.1.key -subj /CN=some-domain \\
              -out /test-data/my-bucket-acme/127.0.0.1.csr &&

            minio server /test-data
          "
    working_directory: ~/repo
    steps:
      - checkout
      - run:
          name: Install dependencies
          command: |
            pip install -r requirements-test.txt
            curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
            chmod +x ./cc-test-reporter
      - run:
          name: Run tests
          command: |
            openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 -subj /CN=selfsigned -keyout route53.key -out route53.crt
            ./cc-test-reporter before-build
            ./tests-with-coverage.sh
            coverage xml
            ./cc-test-reporter after-build --exit-code $?
      - run:
          # These are installed separately to ensure we don't
          # accidentally pass the tests with dependencies not
          # requires by setup.py
          name: Install linting dependencies
          command: |
            pip install pre-commit==1.8.2 pylint==2.4.3
            pre-commit install --install-hooks
      - run:
          name: Run linting
          command: pre-commit run --all-files