diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 000000000..f03b9bd1d Binary files /dev/null and b/.DS_Store differ diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..62291703e --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,31 @@ +# Use the latest 2.1 version of CircleCI pipeline process engine. +# See: https://circleci.com/docs/configuration-reference +version: 2.1 + +# Define a job to be invoked later in a workflow. +# See: https://circleci.com/docs/jobs-steps/#jobs-overview & https://circleci.com/docs/configuration-reference/#jobs +jobs: + say-hello: + # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. + # See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job + docker: + # Specify the version you desire here + # See: https://circleci.com/developer/images/image/cimg/base + - image: cimg/base:current + + # Add steps to the job + # See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps + steps: + # Checkout the code as the first step. + - checkout + - run: + name: "Say hello" + command: "echo Hello, World!" + +# Orchestrate jobs using workflows +# See: https://circleci.com/docs/workflows/ & https://circleci.com/docs/configuration-reference/#workflows +workflows: + say-hello-workflow: # This is the name of the workflow, feel free to change it to better match your workflow. + # Inside the workflow, you define the jobs you want to run. + jobs: + - say-hello \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f33a02cd1..6b8c6a185 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,12 +1,2 @@ # To get started with Dependabot version updates, you'll need to specify which # package ecosystems to update and where the package manifests are located. -# Please see the documentation for more information: -# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates -# https://containers.dev/guide/dependabot - -version: 2 -updates: - - package-ecosystem: "devcontainers" - directory: "/" - schedule: - interval: weekly diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 000000000..ec432e6d4 --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,45 @@ +# This workflow will install Python dependencies, and run tests with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python application + +on: + push: + branches: [ "main" ] + +permissions: + id-token: write + actions: write # Necessary to cancel workflow executions + contents: read + +env: + CLOUDSMITH_SERVICE: gh-actions + +jobs: + build: + + runs-on: ubuntu-latest + environment: dev + + steps: + - uses: actions/checkout@v4 + + - name: Auth to Cloudsmith with OIDC + uses: cloudsmith-io/cloudsmith-cli-action@v1.0.2 + with: + oidc-namespace: 'demo' + oidc-service-slug: ${{ env.CLOUDSMITH_SERVICE }} + oidc-auth-only: 'true' + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install dependencies + run: | + pip install -r requirements.txt --index-url https://$CLOUDSMITH_SERVICE:$CLOUDSMITH_API_KEY@dl.cloudsmith.io/basic/demo/gh-actions/python/simple/ + + - name: Test with pytest + run: | + pytest diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..4fd491f3e --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,41 @@ +# Python package +# Create and test a Python package on multiple Python versions. +# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/python + +trigger: +- main + +pool: + vmImage: ubuntu-latest +strategy: + matrix: + Python37: + python.version: '3.7' + Python38: + python.version: '3.8' + +variables: + - group: 'Cloudsmith Secure Variables' # variable group + +steps: +- task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + displayName: 'Use Python $(python.version)' + +- bash: | + echo "My service name is $CS_SERVICE" + echo "My service API Key is $CS_API_KEY" + python -m pip install --upgrade pip + pip install -r requirements.txt --index-url https://$CS_SERVICE:$CS_API_KEY@dl.cloudsmith.io/basic/demo/azure-devops/python/simple/ + displayName: 'Install dependencies from Cloudsmith' + env: + CS_API_KEY: $(APIKey) + CS_SERVICE: $(ServiceName) + + +- script: | + pip install pytest pytest-azurepipelines + pytest + displayName: 'pytest' diff --git a/requirements.txt b/requirements.txt index e3e9a71d9..57985b5f3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,3 @@ +pytest Flask +Requests==2.6.0