| 1 |
--- |
| 2 |
name: Python Package for Windows |
| 3 |
|
| 4 |
on: |
| 5 |
push: |
| 6 |
branches: [ master ] |
| 7 |
pull_request: |
| 8 |
branches: [ master ] |
| 9 |
|
| 10 |
jobs: |
| 11 |
build: |
| 12 |
runs-on: windows-latest |
| 13 |
timeout-minutes: 20 |
| 14 |
strategy: |
| 15 |
fail-fast: true |
| 16 |
matrix: |
| 17 |
python-version: [3.8, 3.9] |
| 18 |
|
| 19 |
steps: |
| 20 |
- uses: actions/checkout@v2 |
| 21 |
- name: Set up Python ${{ matrix.python-version }} |
| 22 |
uses: actions/setup-python@v2 |
| 23 |
with: |
| 24 |
python-version: ${{ matrix.python-version }} |
| 25 |
- uses: actions/cache@v2 |
| 26 |
with: |
| 27 |
path: ~\AppData\Local\pip\Cache |
| 28 |
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-test-${{ hashFiles('setup.py','requirements.txt','test-requirements.txt') }} |
| 29 |
restore-keys: | |
| 30 |
${{ runner.os }}-${{ matrix.python-version}}-pip-test- |
| 31 |
${{ runner.os }}-${{ matrix.python-version}}-pip- |
| 32 |
${{ runner.os }}-${{ matrix.python-version}}- |
| 33 |
- name: Add msbuild to PATH |
| 34 |
uses: microsoft/[email protected] |
| 35 |
- name: Install dependencies |
| 36 |
run: | |
| 37 |
python -m pip install --upgrade pip |
| 38 |
python -m pip install setuptools wheel |
| 39 |
python -m pip install flake8 pytest |
| 40 |
python -m pip install -r test-requirements.txt |
| 41 |
python -m pip install -r requirements.txt |
| 42 |
- name: Build, install, and run |
| 43 |
run: | |
| 44 |
python setup.py sdist bdist_wheel |
| 45 |
python -m pip -v install --find-links=dist --no-index capirca |
| 46 |
aclgen --output_directory .\output --logtostderr |
| 47 |
powershell Compress-Archive -Force output\* output.zip |
| 48 |
- name: Upload generated policies |
| 49 |
uses: actions/upload-artifact@v2 |
| 50 |
with: |
| 51 |
name: capirca_output_${{ matrix.python-version }} |
| 52 |
path: ./output.zip |