Merge pull request #4 from 2ndWatch/aws_account_columns #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validate Focus Data | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
- issue/** | |
permissions: | |
contents: read | |
actions: read | |
checks: write | |
jobs: | |
validate_focus: | |
name: "Run Validator - ${{ matrix.providers.name }}" | |
strategy: | |
matrix: | |
providers: | |
- name: aws-cur | |
sample_dataset: tests/provider_config_tests/aws/sample-anonymous-aws-export-dataset.csv | |
data_format: csv | |
- name: azure | |
sample_dataset: tests/provider_config_tests/azure/sample-anonymous-ea-export-dataset.csv | |
data_format: csv | |
- name: oci | |
sample_dataset: tests/provider_config_tests/oci/reports_cost-csv_0000000030000269.csv | |
data_format: csv | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Copy converter_base to current directory Linux, MacOS | |
run: | | |
cp -r focus_converter_base/* ./ | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v2 | |
- name: Setup a local virtual environment | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
poetry lock | |
- uses: actions/cache@v3 | |
name: Define a cache for the virtual environment based on the dependencies lock file | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }} | |
- name: Install dependencies | |
run: | | |
poetry install | |
- name: Convert sample dataset | |
run: | | |
poetry run focus-converter convert \ | |
--data-path ${{ matrix.providers.sample_dataset }} \ | |
--export-path /tmp/${{ matrix.providers.name }}/ \ | |
--provider ${{ matrix.providers.name }} \ | |
--data-format ${{ matrix.providers.data_format }} | |
- name: super-step | |
shell: sh | |
run: | | |
mkdir -p reports | |
poetry run focus-validator \ | |
--data-file /tmp/${{ matrix.providers.name }}//*.parquet \ | |
--output-type unittest \ | |
--output-destination reports/focus_tests_${{ matrix.providers.name }}.xml | |
- name: FOCUS Validation Report-2 ${{ matrix.providers.name }} | |
uses: dorny/test-reporter@v1 | |
if: success() || failure() # run this step even if previous step failed | |
continue-on-error: true | |
with: | |
name: validate_focus-test-results-${{ matrix.providers.name }} | |
path: reports/focus_tests_${{ matrix.providers.name }}.xml | |
reporter: java-junit |