|
| 1 | +name: End to end tests |
| 2 | +on: [push, pull_request] |
| 3 | +jobs: |
| 4 | + generate_stats: |
| 5 | + runs-on: ubuntu-latest |
| 6 | + steps: |
| 7 | + - name: Checkout this repo |
| 8 | + uses: actions/checkout@v2 |
| 9 | + with: |
| 10 | + persist-credentials: false |
| 11 | + - name: Set up Python 3.7 |
| 12 | + uses: actions/setup-python@v2 |
| 13 | + with: |
| 14 | + python-version: 3.7 |
| 15 | + - uses: actions/cache@v2 |
| 16 | + name: Cache dependencies |
| 17 | + with: |
| 18 | + path: ~/.cache/pip |
| 19 | + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} |
| 20 | + restore-keys: | |
| 21 | + ${{ runner.os }}-pip- |
| 22 | + - name: Install dependencies |
| 23 | + run: | |
| 24 | + python -m pip install --upgrade pip |
| 25 | + pip install -r requirements.txt |
| 26 | + - name: Install some extras |
| 27 | + run: | |
| 28 | + cd helpers |
| 29 | + git clone --branch version-2.03 https://github.com/IATI/IATI-Rulesets.git |
| 30 | + ln -s IATI-Rulesets/rulesets . |
| 31 | + ./get_codelist_mapping.sh |
| 32 | + ./get_codelists.sh |
| 33 | + ./get_schemas.sh |
| 34 | + wget -q "https://raw.githubusercontent.com/codeforIATI/IATI-Dashboard/main/registry_id_relationships.csv" |
| 35 | + wget -q https://codeforiati.org/imf-exchangerates/imf_exchangerates_A_ENDA_USD.csv -O currency_conversion/exchange_rates.csv |
| 36 | + cd .. |
| 37 | + - name: Symlink fixtures for IATI data |
| 38 | + run: ln -s tests_end_to_end/fixtures/{data,metadata,metadata.json} . |
| 39 | + - name: Create output dir |
| 40 | + run: mkdir out |
| 41 | + - name: Generate ckan.json |
| 42 | + run: | |
| 43 | + echo '{}' > helpers/ckan.json |
| 44 | +# python helpers/ckan.py |
| 45 | +# cp ckan.json out |
| 46 | +# mv ckan.json helpers |
| 47 | +# mv metadata.json out |
| 48 | +# mv licenses.json out |
| 49 | + - name: Run loop |
| 50 | + run: python calculate_stats.py --output out/current --multi 2 loop |
| 51 | + - name: Run aggregate |
| 52 | + run: python calculate_stats.py --output out/current aggregate |
| 53 | + - name: Run invert |
| 54 | + run: python calculate_stats.py --output out/current invert |
| 55 | + - name: cat |
| 56 | + run: cat out/current/aggregated/traceable_activities_by_publisher_id.json |
0 commit comments