Skip to content

Commit 20ec2c5

Browse files
authored
Merge pull request #42 from FullStackWithLawrence/next
fix: add missing actions
2 parents 08e1bf4 + 6f788fa commit 20ec2c5

3 files changed

Lines changed: 155 additions & 1 deletion

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
#------------------------------------------------------------------------------
3+
# Run pre-commit
4+
#------------------------------------------------------------------------------
5+
name: Merge
6+
branding:
7+
icon: "git-pull-request"
8+
color: "orange"
9+
inputs:
10+
github-token:
11+
description: "The GitHub token to use for authentication"
12+
required: true
13+
type: string
14+
source-branch:
15+
description: "The branch to merge from"
16+
required: false
17+
type: string
18+
default: "main"
19+
target-branch:
20+
description: "The branch to merge to"
21+
required: true
22+
type: string
23+
24+
python-version:
25+
description: "The version of Python to use, such as 3.11.0"
26+
required: true
27+
type: string
28+
29+
runs:
30+
using: "composite"
31+
steps:
32+
- name: Checkout code
33+
id: checkout
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
37+
persist-credentials: false
38+
39+
- name: Remember current branch
40+
shell: bash
41+
run: |
42+
echo "CURRENT_BRANCH=$(git branch --show-current)" >> $GITHUB_ENV
43+
44+
- name: Merge
45+
id: merge
46+
shell: bash
47+
run: |
48+
git config --local user.email "action@github.com"
49+
git config --local user.name "GitHub Action"
50+
git checkout ${{ inputs.source-branch }}
51+
git pull
52+
git checkout ${{ inputs.target-branch }}
53+
git merge -Xtheirs ${{ inputs.source-branch }}
54+
git push https://${{ inputs.github-token }}@github.com/${{ github.repository }}.git HEAD:${{ inputs.target-branch }}
55+
56+
- name: Checkout current branch
57+
shell: bash
58+
run: |
59+
git checkout ${{ env.CURRENT_BRANCH }}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
#------------------------------------------------------------------------------
3+
# Run Python unit tests
4+
#------------------------------------------------------------------------------
5+
name: Test Python
6+
branding:
7+
icon: "git-pull-request"
8+
color: "orange"
9+
inputs:
10+
python-version:
11+
description: "The version of Python to use, such as 3.11.0"
12+
required: true
13+
type: string
14+
openai-api-organization:
15+
description: "The OpenAI API organization"
16+
required: true
17+
type: string
18+
openai-api-key:
19+
description: "The OpenAI API key"
20+
required: true
21+
type: string
22+
pinecone-api-key:
23+
description: "The Pinecone API key"
24+
required: true
25+
type: string
26+
pinecone-environment:
27+
description: "The Pinecone environment"
28+
required: true
29+
type: string
30+
pinecone-index-name:
31+
description: "The Pinecone index name"
32+
required: true
33+
type: string
34+
35+
env:
36+
REQUIREMENTS_PATH: "api/terraform/python/layer_genai/requirements.txt"
37+
38+
runs:
39+
using: "composite"
40+
steps:
41+
- name: Checkout code
42+
id: checkout
43+
uses: actions/checkout@v4
44+
45+
- name: Cache Python dependencies
46+
uses: actions/cache@v3
47+
with:
48+
path: ~/.cache/pip
49+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
50+
restore-keys: |
51+
${{ runner.os }}-pip
52+
53+
- name: Set up Python
54+
uses: actions/setup-python@v4
55+
with:
56+
python-version: ${{ inputs.python-version }}
57+
58+
- name: locate site-packages path
59+
shell: bash
60+
run: |
61+
echo "SITE_PACKAGES_PATH=$(python -c 'import site; print(site.getsitepackages()[0])')" >> $GITHUB_ENV
62+
63+
- name: Install pip
64+
shell: bash
65+
run: |
66+
python -m pip install --upgrade pip
67+
68+
- name: Install dependencies
69+
shell: bash
70+
run: |
71+
pip install -r ./requirements.txt
72+
env:
73+
SITE_PACKAGES_PATH: ${{ env.SITE_PACKAGES_PATH }}
74+
75+
- name: Create .env
76+
shell: bash
77+
run: |
78+
touch ./.env
79+
echo "OPENAI_API_ORGANIZATION=${{ env.OPENAI_API_ORGANIZATION }}" >> ./.env
80+
echo "OPENAI_API_KEY=${{ env.OPENAI_API_KEY }}" >> ./.env
81+
echo "PINECONE_API_KEY=${{ env.PINECONE_API_KEY }}" >> ./.env
82+
echo "PINECONE_ENVIRONMENT=${{ env.PINECONE_ENVIRONMENT }}" >> ./.env
83+
echo "PINECONE_INDEX_NAME=${{ env.PINECONE_INDEX_NAME }}" >> ./.env
84+
env:
85+
OPENAI_API_ORGANIZATION: ${{ inputs.openai-api-organization }}
86+
OPENAI_API_KEY: ${{ inputs.openai-api-key }}
87+
PINECONE_API_KEY: ${{ inputs.pinecone-api-key }}
88+
PINECONE_ENVIRONMENT: ${{ inputs.pinecone-environment }}
89+
PINECONE_INDEX_NAME: ${{ inputs.pinecone-index-name }}
90+
91+
- name: Run Tests
92+
shell: bash
93+
run: |
94+
cd models && pytest -v -s tests/
95+
python -m setup_test

secure_logger/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# -*- coding: utf-8 -*-
2-
__version__ = "0.1.17"
2+
__version__ = "0.1.18-next.1"

0 commit comments

Comments
 (0)