Skip to content

Commit

Permalink
create separate subactions for windows/mac setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchelbaker-cisa committed Jul 26, 2024
1 parent 9903963 commit a77882b
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 35 deletions.
35 changes: 0 additions & 35 deletions .github/actions/initialize-scubagoggles/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ inputs:
cache-dependency-path:
required: true
default: "requirements.txt"
operating-system:
required: true
default: "windows"
opa-version:
required: true
default: "0.60.0"

runs:
using: "composite"
Expand All @@ -22,32 +16,3 @@ runs:
python-version: ${{ inputs.python-version }}
cache: "pip"
cache-dependency-path: ${{ inputs.cache-dependency-path }}

- name: Setup virtualenv for Windows
if: ${{ inputs.operating-system }} == "windows"
shell: powershell
run: |
pip install virtualenv
python -m venv .venv
.venv\Scripts\activate
- name: Setup virtualenv for MacOS
if: ${{ inputs.operating-system }} == "macos"
shell: bash
run: |
pip install virtualenv
virtualenv -p python .venv
source .venv/bin/activate
- name: Install dependencies
shell: powershell
run: |
python -m pip install .
pip install -r requirements.txt
pip install pytest
pip uninstall numpy
pip install -y numpy==1.26.4
- name: Download OPA executable
shell: powershell
run: python download_opa.py -v ${{ inputs.opa-version }} -os ${{ inputs.operating-system }}
29 changes: 29 additions & 0 deletions .github/actions/setup-macos-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Setup MacOS Dependencies
inputs:
operating-system:
required: true
default: "macos"
opa-version:
required: true
default: "0.60.0"

runs:
using: "composite"
shell: bash
steps:
- name: Setup virtualenv
run: |
pip install virtualenv
virtualenv -p python .venv
source .venv/bin/activate
- name: Install dependencies
run: |
python -m pip install .
pip install -r requirements.txt
pip install pytest
pip uninstall numpy
pip install -y numpy==1.26.4
- name: Download OPA executable
run: python download_opa.py -v ${{ inputs.opa-version }} -os ${{ inputs.operating-system }}
29 changes: 29 additions & 0 deletions .github/actions/setup-windows-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Setup Windows Dependencies
inputs:
operating-system:
required: true
default: "windows"
opa-version:
required: true
default: "0.60.0"

runs:
using: "composite"
shell: powershell
steps:
- name: Setup virtualenv
run: |
pip install virtualenv
python -m venv .venv
.venv\Scripts\activate
- name: Install dependencies
run: |
python -m pip install .
pip install -r requirements.txt
pip install pytest
pip uninstall numpy
pip install -y numpy==1.26.4
- name: Download OPA executable
run: python download_opa.py -v ${{ inputs.opa-version }} -os ${{ inputs.operating-system }}
8 changes: 8 additions & 0 deletions .github/workflows/run_smoke_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ jobs:
with:
python-version: "3.12"
cache-dependency-path: "requirements.txt"

- name: Setup Windows dependencies
uses: ./.github/actions/setup-windows-dependencies
with:
operating-system: "windows"
opa-version: "0.60.0"

Expand All @@ -57,6 +61,10 @@ jobs:
with:
python-version: "3.12"
cache-dependency-path: "requirements.txt"

- name: Setup MacOS dependencies
uses: ./.github/actions/setup-macos-dependencies
with:
operating-system: "macos"
opa-version: "0.60.0"

Expand Down

0 comments on commit a77882b

Please sign in to comment.