-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (67 loc) · 3.19 KB
/
test_example_system.yml
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
76
77
78
79
80
81
82
83
name: Daily PowerGenome outputs test
on: [push]
jobs:
run-pg-example:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout GenX.jl from the specified repository and branch
- name: Checkout GenX.jl repository
uses: actions/checkout@v3
with:
repository: GenXProject/GenX.jl
ref: support/0.3.x
path: GenX.jl
# Step 2: Install Julia
- name: Set up Julia
# run: |
# curl -fsSL https://install.julialang.org | sh -s -- --yes
uses: julia-actions/setup-julia@v2
# with:
# version: '1.6'
# arch: aarch64
# Step 3: Install GenX.jl package using the checked out directory
- name: Install GenX.jl
run: |
cd GenX.jl
julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.precompile()'
# Step 4: Checkout the current repository
- name: Checkout current repository
uses: actions/checkout@v4
with:
path: current-repo
- name: Checkout PowerGenome repository
uses: actions/checkout@v3
with:
repository: PowerGenome/PowerGenome
path: PowerGenome
# Step 5: Create env.yml in the specified directory
- name: Create env.yml file
run: |
mkdir -p ${{ github.workspace }}/current-repo/example_systems/CONUS-3-zone/settings
echo 'PUDL_DB: sqlite://///${{ github.workspace }}/current-repo/tests/data/pudl_test_data.db' > ${{ github.workspace }}/current-repo/example_systems/CONUS-3-zone/settings/env.yml
echo 'PG_DB: sqlite://///${{ github.workspace }}/current-repo/tests/data/pg_misc_tables.sqlite3' >> ${{ github.workspace }}/current-repo/example_systems/CONUS-3-zone/settings/env.yml
echo 'EFS_DATA: ${{ github.workspace }}/current-repo/tests/data/efs' >> ${{ github.workspace }}/current-repo/example_systems/CONUS-3-zone/settings/env.yml
echo 'DISTRIBUTED_GEN_DATA: ${{ github.workspace }}/current-repo/tests/data/dist_gen' >> ${{ github.workspace }}/current-repo/example_systems/CONUS-3-zone/settings/env.yml
echo 'RESOURCE_GROUPS: ${{ github.workspace }}/current-repo/tests/data/resource_groups_base' >> ${{ github.workspace }}/current-repo/example_systems/CONUS-3-zone/settings/env.yml
- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ github.workspace }}/current-repo/environment.yml
cache-environment: true
- name: install powergenome
run: |
cd PowerGenome
pip install -e .
cd ..
- name: Run PowerGenome
run: |
cd ${{ github.workspace }}/current-repo/example_systems/CONUS-3-zone/settings
sed -i 's/nrel_cambium_distr_pv_2022_utc.parquet/nrel_cambium_distr_pv_2022_slim.parquet/' distributed_gen.yml
cd ../..
cp Run.jl CONUS-3-zone/genx-test/p1/Inputs/Inputs_p1/
cp -r Settings/ CONUS-3-zone/genx-test/p1/Inputs/Inputs_p1/
cd CONUS-3-zone
run_powergenome_multiple -sf settings -rf genx-test -c p1 -mp
- name: Run GenX
run: |
julia project=${{ github.workspace }}/GenX.jl ${{ github.workspace }}/current-repo/example_systems/CONUS-3-zone/genx-test/p1/Inputs/Inputs_p1/Run.jl