Skip to content

Commit

Permalink
feat: Feature/secureli 394 gh cache action (#405)
Browse files Browse the repository at this point in the history
secureli-394

<!-- Include general description here -->
This PR enables github caching for various build and testing steps


## Changes
<!-- A detailed list of changes -->
* Update .github/workflows/build_and_test.yml with caching options
* Update .github/workflows/integration_testing.yml with caching options

## Testing
<!--
Mention updated tests and any manual testing performed.
Are aspects not yet tested or not easily testable?
Feel free to include screenshots if appropriate.
 -->
* No new tests

## Clean Code Checklist
<!-- This is here to support you. Some/most checkboxes may not apply to
your change -->
- [X] Meets acceptance criteria for issue
- [ ] New logic is covered with automated tests
- [ ] Appropriate exception handling added
- [ ] Thoughtful logging included
- [ ] Documentation is updated
- [ ] Follow-up work is documented in TODOs
- [ ] TODOs have a ticket associated with them
- [X] No commented-out code included


<!--
Github-flavored markdown reference:
https://docs.github.com/en/get-started/writing-on-github
-->
  • Loading branch information
joe-stafford authored Jan 26, 2024
1 parent 05deb62 commit 2797f03
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 6 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Poetry
run: pip install poetry

- name: Set up Python 3.9
id: setup-python
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: 'poetry'

- name: Set Up Project
run: |
pip install poetry
poetry install
- name: Run Tests
Expand All @@ -48,15 +51,18 @@ jobs:
- name: Validate Branch name
run: ./scripts/get-current-branch.sh

- name: Set up Poetry
run: pip install poetry

- name: Set up Python 3.9
id: setup-python
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: 'poetry'

- name: Set Up Project
run: |
pip install poetry
poetry install
- name: Install BATS for e2e tests
Expand Down
51 changes: 47 additions & 4 deletions .github/workflows/integration_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,25 @@ jobs:
with:
python-version: "3.10"

- name: Cache pip repo
id: cache-pip-repo-windows
uses: actions/cache@v4
with:
path: pip
key: ${{ runner.os }}-repo-pip

- uses: actions/checkout@v4
if: steps.cache-pip-repo-windows.outputs.cache-hit != 'true'
with:
repository: pypa/pip
path: pip
fetch-depth: 0

- name: Install seCureLI
# Note that this is a powershell script
run: |
pip3 --version
pip3 install secureli
git clone https://github.com/pypa/pip pip
cd pip
secureli init --yes
Expand All @@ -40,6 +53,13 @@ jobs:
- name: Test with Homebrew
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

- name: Cache homebrew
id: cache-homebrew-mac
uses: actions/cache@v4
with:
path: ~/Library/Caches/Homebrew
key: ${{ runner.os }}-homebrew-cache

- name: Preinstall Formula Dependencies
env:
HOMEBREW_NO_AUTO_UPDATE: 1
Expand All @@ -58,11 +78,19 @@ jobs:
run: |
brew install --display-times --verbose secureli
- name: Checkout test repo
uses: actions/checkout@v4
- name: Cache pip repo
id: cache-pip-repo-mac
uses: actions/cache@v4
with:
path: pip
key: ${{ runner.os }}-repo-pip

- uses: actions/checkout@v4
if: steps.cache-pip-repo-mac.outputs.cache-hit != 'true'
with:
repository: pypa/pip
path: pip
fetch-depth: 0

- name: Init seCureLI
run: |
Expand All @@ -80,13 +108,28 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Cache pip repo
id: cache-pip-repo-mac
uses: actions/cache@v4
with:
path: pip
key: ${{ runner.os }}-repo-pip

- uses: actions/checkout@v4
if: steps.cache-pip-repo-mac.outputs.cache-hit != 'true'
with:
repository: pypa/pip
path: pip
fetch-depth: 0

- name: Install seCureLI from Pypi
run: |
pip3 --version # Validate python/pip version
pip3 install secureli
- name: Scan repo with Pypi seCureLI package
run: |
git clone https://github.com/pypa/pip pip
cd pip
secureli init --yes
# In the future, we should use specific exit codes to differentiate between exit reasons
Expand Down

0 comments on commit 2797f03

Please sign in to comment.