forked from finopsfoundation/focus_converters
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (75 loc) · 2.65 KB
/
focus_validation.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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