-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
97 lines (88 loc) · 3.02 KB
/
action.yml
File metadata and controls
97 lines (88 loc) · 3.02 KB
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
# Copyright 2025 Lincoln Institute of Land Policy
# SPDX-License-Identifier: Apache-2.0
name: "Geoconnex Scheduler E2E Test"
description: "Reusable GitHub Action to run E2E tests for the Dagster build"
# Allow specifying a custom docker image so we can test specific versions
inputs:
nabu_image:
required: true
description: "Docker image to use for Nabu"
runs:
using: "composite"
steps:
# We have to conditionally checkout the repo since there are multiple different scenarios
#
# - scheduler runs this on main
# - scheduler runs this on a PR
# - nabu runs this
#
# If we don't conditionally check out the repo we could check it out twice
# when testing scheduler in a PR. And if that is the case we should use the parent's
# checkout and branch, not main.
# This cannot be accomplished easily with the `actions/checkout` action
- name: Conditionally Checkout Scheduler Repo
shell: bash
run: |
if [ "$GITHUB_REPOSITORY" != "internetofwater/scheduler" ]; then
echo "Checking out scheduler repo into root..."
rm -rf ./* .??* || true
git clone --depth=1 --branch main https://github.com/internetofwater/scheduler.git .
else
echo "Already in internetofwater/scheduler — skipping checkout"
fi
- name: Set up Docker
uses: docker/setup-buildx-action@v2
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies and local services
shell: bash
# these are ran in parallel to speed up the process
run: |
make up &
uv sync &
wait
- name: Debug Docker Containers
shell: bash
run: docker ps -a
- name: Check MinIO Logs
shell: bash
run: |
CONTAINER_ID=$(docker ps -q --filter "name=minio")
if [ -n "$CONTAINER_ID" ]; then
docker logs $CONTAINER_ID
else
echo "MinIO container not found!"
exit 1
fi
- name: Wait for MinIO
shell: bash
run: |
for i in {1..10}; do
if curl --max-time 10 -fs http://127.0.0.1:9001/minio/health/live; then
echo "MinIO is up!"
exit 0
fi
echo "Waiting for MinIO to be ready... Attempt $i"
sleep 2
done
echo "Failed to connect to MinIO after 10 attempts."
exit 1
- name: Run tests that don't require secrets
shell: bash
run: |
echo "Starting tests"
NABU_IMAGE="${{ inputs.nabu_image }}" uv run pytest -n auto -x -vv --cov-branch --cov-report=xml --cov
if [ ! -f coverage.xml ]; then
echo "Coverage report not found!"
exit 1
fi
echo "Absolute path of coverage.xml: $(realpath coverage.xml)"
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: scheduler-code-coverage-report
path: coverage.xml
if-no-files-found: error