-
Notifications
You must be signed in to change notification settings - Fork 2
99 lines (93 loc) · 3.44 KB
/
test-action.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Test action
on:
push:
branches: ["main"]
pull_request:
branches: [ "*" ]
jobs:
test:
name: (recipes@${{ matrix.recipes-version }}, config=${{ matrix.config }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
recipes-version: [
# "main",
# "0.10.3",
"0.10.4",
]
config: [
"inline",
"file",
]
steps:
- uses: actions/checkout@v4
# ----- Shared setup --------------------------------------------------------------
- name: "Clone test feedstock"
# Fetches test feedstock (containing example test recipes) from pangeo-forge-recipes
run: |
git clone --depth 1 --branch ${{ matrix.recipes-version }} https://github.com/pangeo-forge/pangeo-forge-recipes.git
- name: "Add requirements.txt"
# The clone step above gives us recipe modules and meta.yaml, but does not contain a requirements file,
# so we add that here, providing the action with the correct version of pangeo-forge-recipes to install
# in the container at action runtime.
run: |
echo "pangeo-forge-recipes==${{ matrix.recipes-version }}" > pangeo-forge-recipes/examples/feedstock/requirements.txt
- name: "Overwrite meta.yaml"
# The example feedstock contains multiple recipes, but we just want to test gpcp
run: |
grep -E 'recipes|gpcp' pangeo-forge-recipes/examples/feedstock/meta.yaml > temp.yaml \
&& mv temp.yaml pangeo-forge-recipes/examples/feedstock/meta.yaml
# ----- File based config ---------------------------------------------------------
- name: Write local-config.json
if: matrix.config == 'file'
run: |
cat << EOF > ./local-config.json
{
"BaseCommand": {
"feedstock_subdir": "pangeo-forge-recipes/examples/feedstock"
},
"Bake": {
"prune": true,
"bakery_class": "pangeo_forge_runner.bakery.local.LocalDirectBakery"
},
"TargetStorage": {
"fsspec_class": "fsspec.implementations.local.LocalFileSystem",
"root_path": "./target"
},
"InputCacheStorage": {
"fsspec_class": "fsspec.implementations.local.LocalFileSystem",
"root_path": "./cache"
}
}
EOF
- name: "Deploy recipes"
if: matrix.config == 'file'
uses: ./
with:
# select_recipe_by_label: true
pangeo_forge_runner_config: ./local-config.json
# ---- Inline config --------------------------------------------------------------
- name: "Deploy recipes"
if: matrix.config == 'inline'
uses: ./
with:
# select_recipe_by_label: true
pangeo_forge_runner_config: >
{
"BaseCommand": {
"feedstock_subdir": "pangeo-forge-recipes/examples/feedstock"
},
"Bake": {
"prune": true,
"bakery_class": "pangeo_forge_runner.bakery.local.LocalDirectBakery"
},
"TargetStorage": {
"fsspec_class": "fsspec.implementations.local.LocalFileSystem",
"root_path": "./target"
},
"InputCacheStorage": {
"fsspec_class": "fsspec.implementations.local.LocalFileSystem",
"root_path": "./cache"
}
}