First GH workflow attempt

This commit is contained in:
Francesco Mazzoli
2023-06-15 13:55:46 +00:00
parent 2ce1b1904f
commit 016c4bf162
5 changed files with 9 additions and 4 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ build_dir.mkdir(parents=True, exist_ok=True)
if build_type in ('alpine', 'alpine-debug') and 'IN_EGGS_BUILD_CONTAINER' not in os.environ:
subprocess.run(
['docker', 'run', '--rm', '-i', '--mount', f'type=bind,src={repo_dir},dst=/eggsfs', 'REDACTED', '/eggsfs/cpp/build.py', build_type] + sys.argv[2:],
['docker', 'run', '--rm', '-i', '--mount', f'type=bind,src={repo_dir},dst=/eggsfs', '-u', f'{os.getuid()}:{os.getgid()}', 'REDACTED', '/eggsfs/cpp/build.py', build_type] + sys.argv[2:],
check=True,
)
else:
+4 -1
View File
@@ -17,10 +17,13 @@ if len(paths) == 0:
if 'IN_EGGS_BUILD_CONTAINER' not in os.environ:
subprocess.run(
['docker', 'run', '--rm', '-i', '--mount', f'type=bind,src={repo_dir},dst=/eggsfs', 'REDACTED', '/eggsfs/go/build.py'] + paths,
['docker', 'run', '--rm', '-i', '--mount', f'type=bind,src={repo_dir},dst=/eggsfs', '-u', f'{os.getuid()}:{os.getgid()}', 'REDACTED', '/eggsfs/go/build.py'] + paths,
check=True,
)
else:
# Otherwise go will try to create the cache in /.cache, which won't work
# since we're not running as root.
os.environ['GOCACHE'] = '/eggsfs/.cache'
for path_str in paths:
print(f'Building {path_str}')
path = go_dir / Path(path_str)
+1 -1
View File
@@ -62,7 +62,7 @@ func main() {
}
if *dataDir == "" {
dir, err := os.MkdirTemp("", "eggsrun.")
dir, err := os.MkdirTemp(".", "eggsrun.")
if err != nil {
panic(fmt.Errorf("could not create tmp data dir: %w", err))
}
+1 -1
View File
@@ -421,7 +421,7 @@ func main() {
cleanupDbDir := false
tmpDataDir := *dataDir == ""
if tmpDataDir {
dir, err := os.MkdirTemp("", "eggs-integrationtest.")
dir, err := os.MkdirTemp(".", "eggs-integrationtest.")
if err != nil {
panic(fmt.Errorf("could not create tmp data dir: %w", err))
}
+2
View File
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -eu -o pipefail
export PATH="/opt/go1.18.4/bin:$PATH"
echo "$(tput bold)building requisites$(tput sgr0)"
./cpp/build.py alpine rs crc32c # build libs for go
(cd go/msgs && go generate ./...)