Skip to content

Generate single inventory #72

Generate single inventory

Generate single inventory #72

# This workflow will generate inventory files based on user input
name: Generate single inventory
on:
workflow_dispatch: # manual trigger only
inputs:
year:
description: "Year"
required: true
default: "2016-2018"
inventory:
description: "Inventory"
required: true
default: "TRI"
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Update pip & install testing pkgs
run: |
python -VV
python -m pip install --upgrade pip setuptools wheel
- name: Install package and dependencies
run: |
pip install .
- name: Generate inventory files
env:
YEAR: ${{ github.event.inputs.year }}
INVENTORY: ${{ github.event.inputs.inventory }}
run: |
echo "Year: ${{ github.event.inputs.year }}"
echo "Inventory: ${{ github.event.inputs.inventory }}"
python scripts/generate_select_inventories.py --years $YEAR --inventory $INVENTORY
- name: Upload files
uses: actions/upload-artifact@v3
with:
# Artifact name
name: "${{ github.event.inputs.inventory }}"
# A file, directory or wildcard patter that describes what to upload
path: | # uses local user data dir for ubuntu
~/.local/share/stewi/facility/*
~/.local/share/stewi/flow/*
~/.local/share/stewi/flowbyfacility/*
~/.local/share/stewi/flowbyprocess/*
~/.local/share/stewi/validation/*
~/.local/share/stewi/*.json
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`
# retention-days: 5 # cannot exceed the retention limit set by the repository, organization, or enterprise.