Skip to content

Commit 7011d80

Browse files
committed
build(flox): Reorganize Flox environments
Prepare for adding more Flox environments by moving the single existing environment to a subdirectory and add a convenience script to run this minimal environment in isolation. Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
1 parent 87ed958 commit 7011d80

File tree

8 files changed

+37
-2
lines changed

8 files changed

+37
-2
lines changed

.github/workflows/build-and-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
disable-metrics: true
7474
if: runner.os != 'Windows'
7575
- name: Run unit tests in a minimal environment
76-
run: env -i "$(which flox)" activate -- ./gradlew --scan test jacocoTestReport
76+
run: ./flox/run_isolated.sh minimal ./gradlew --scan test jacocoTestReport
7777
if: runner.os != 'Windows'
7878
- name: Run unit tests
7979
run: ./gradlew --scan test jacocoTestReport
@@ -101,7 +101,7 @@ jobs:
101101
with:
102102
disable-metrics: true
103103
- name: Run functional tests that do not require external tools
104-
run: env -i "$(which flox)" activate -- ./gradlew --scan -Dkotest.tags=!RequiresExternalTool funTest jacocoFunTestReport
104+
run: ./flox/run_isolated.sh minimal ./gradlew --scan -Dkotest.tags=!RequiresExternalTool funTest jacocoFunTestReport
105105
- name: Create Test Summary
106106
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2
107107
with:

REUSE.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ path = ".**"
1010
SPDX-FileCopyrightText = "2017 The ORT Project Authors (see <https://github.com/oss-review-toolkit/ort/blob/main/NOTICE>)"
1111
SPDX-License-Identifier = "Apache-2.0"
1212

13+
[[annotations]]
14+
path = "**/.flox/**"
15+
SPDX-FileCopyrightText = "2025 The ORT Project Authors (see <https://github.com/oss-review-toolkit/ort/blob/main/NOTICE>)"
16+
SPDX-License-Identifier = "Apache-2.0"
17+
1318
[[annotations]]
1419
path = "**/.gitattributes"
1520
SPDX-FileCopyrightText = "2018 The ORT Project Authors (see <https://github.com/oss-review-toolkit/ort/blob/main/NOTICE>)"

flox/run_isolated.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (C) 2025 The ORT Project Authors (see <https://github.com/oss-review-toolkit/ort/blob/main/NOTICE>)
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# SPDX-License-Identifier: Apache-2.0
18+
# License-Filename: LICENSE
19+
20+
SELF="${BASH_SOURCE[0]}"
21+
22+
if [ "$#" -lt 2 ]; then
23+
echo "Usage: $SELF <environment directory> <command to run>" >&2
24+
exit 1
25+
fi
26+
27+
ENV_DIR="$(dirname "$SELF")/$1"
28+
shift
29+
30+
env -i "$(which flox)" activate -d "$ENV_DIR" -- "$@"

0 commit comments

Comments
 (0)