Skip to content

Commit

Permalink
Classify builds by release milestone (#1632)
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo authored Mar 12, 2024
1 parent 5d82a06 commit 845766d
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 26 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ on:
workflow_dispatch:

env:
ALIRE_OS: "windows"
ALIRE_OS: windows
MINGW64_PATH: C:\Users\runneradmin\AppData\Local\alire\cache\msys64\mingw64\bin
MSYS2_PATH: C:\Users\runneradmin\AppData\Local\alire\cache\msys64\usr\bin
PACMAN: C:\Users\runneradmin\AppData\Local\alire\cache\msys64\usr\bin\pacman --noconfirm

jobs:

Expand All @@ -35,11 +38,11 @@ jobs:
- name: Build alr
run: gprbuild -j0 -p -P alr_env

- name: alr first run to install msys2
run: ./bin/alr --non-interactive help get
- name: Display built alr and trigger install of msys2
run: ./bin/alr version

- name: install tar from msys2 (Git tar in Actions VM does not seem to work)
run: C:\Users\runneradmin\AppData\Local\alire\msys64\usr\bin\pacman --noconfirm -S tar
run: ${{env.PACMAN}} -S tar

- name: Install Python 3.x (required for the testsuite)
uses: actions/setup-python@v2
Expand All @@ -57,17 +60,17 @@ jobs:
run: gprinstall -p -P alr_env --prefix=${{ runner.temp }}/alr_install

- name: Install qt-installer-framework in msys2
run: C:\Users\runneradmin\AppData\Local\alire\msys64\usr\bin\pacman --noconfirm -S mingw64/mingw-w64-x86_64-qt-installer-framework
run: ${{env.PACMAN}} -S mingw64/mingw-w64-x86_64-qt-installer-framework

- name: Add msys2 /mingw64/bin to the path (for qt-installer-framework)
run: echo 'C:\Users\runneradmin\AppData\Local\alire\msys64\mingw64\bin' >> $GITHUB_PATH
run: echo '${{env.MINGW64_PATH}}' >> $GITHUB_PATH
shell: bash

- name: Install zip in msys2
run: C:\Users\runneradmin\AppData\Local\alire\msys64\usr\bin\pacman --noconfirm -S zip
run: ${{env.PACMAN}} --noconfirm -S zip

- name: Add msys2 /usr/bin to the path (for zip)
run: echo 'C:\Users\runneradmin\AppData\Local\alire\msys64\usr\bin' >> $GITHUB_PATH
run: echo '${{env.MSYS2_PATH}}' >> $GITHUB_PATH
shell: bash

- name: Run installer build script
Expand Down
5 changes: 2 additions & 3 deletions src/alire/alire-builds.adb
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,8 @@ package body Alire.Builds is
is
Base : constant Absolute_Path :=
Builds.Path
/ (Release.Deployment_Folder
& "_"
& Root.Build_Hash (Release.Name));
/ Release.Deployment_Folder
/ Root.Build_Hash (Release.Name);
begin
if Subdir and then Release.Origin.Is_Monorepo then
return Base / Release.Origin.Subdir;
Expand Down
1 change: 1 addition & 0 deletions testsuite/drivers/asserts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import re
import difflib
import sys

from drivers.alr import run_alr
from drivers.helpers import contents, lines_of
Expand Down
16 changes: 5 additions & 11 deletions testsuite/drivers/builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,21 @@ def are_shared() -> bool:
return False


def clear_builds_dir() -> None:
"""
Clear the shared build directory
"""
rmtree(path())


def find_dir(crate_name: str) -> str:
"""
Find the build dir of a crate in the shared build directory
Find the build dir of a crate in the shared build directory. It always uses
forward slashes in the returned folder path.
"""
if len(found := glob(f"{path()}/{crate_name}_*")) != 1:
if len(found := glob(f"{path()}/{crate_name}*/*")) != 1:
raise AssertionError(f"Unexpected number of dirs for crate {crate_name}: {found}")
return glob(f"{path()}/{crate_name}_*")[0]
return glob(f"{path()}/{crate_name}*/*")[0].replace(os.sep, "/")


def find_hash(crate_name: str) -> str:
"""
Find the hash of a crate in the shared build directory
"""
return find_dir(crate_name).split("_")[-1]
return find_dir(crate_name).split("/")[-1]


def hash_input(crate_name: str, as_lines: bool=False) -> str:
Expand Down
2 changes: 1 addition & 1 deletion testsuite/tests/dockerized/misc/default-cache/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# procedures)
hash = "0774083df8ff003084c32cabdec6090a58b41c6be317cec0475df5eacbca0d23"
assert \
os.path.isdir(f"{base}/builds/crate_real_1.0.0_filesystem_{hash}"), \
os.path.isdir(f"{base}/builds/crate_real_1.0.0_filesystem/{hash}"), \
f"Shared build not found at the expected location: f{contents(base)}"

print('SUCCESS')
2 changes: 1 addition & 1 deletion testsuite/tests/pin/downgrade/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def check_child(version, output, pinned):
# Verify dependency folders
if builds.are_shared():
run_alr('update') # force hash computation
assert builds.find_dir('libchild_' + version + '_filesystem')
assert builds.find_dir('libchild_' + version)
else:
assert os.path.exists('alire/cache/dependencies/libchild_' + version +
'_filesystem')
Expand Down
4 changes: 2 additions & 2 deletions testsuite/tests/settings/shared-deps/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ def check_in(file : str, expected : str) -> bool:
# because no build has been attempted yet, hence a sync has not been performed.
# And, since there's no sync yet, neither the build dir exists:

assert len(glob.glob(os.path.join(build_dir, "hello_1.0.1_filesystem_*"))) == 0, \
assert len(glob.glob(os.path.join(build_dir, "hello_1.0.1_filesystem/*"))) == 0, \
"Build dir should not exist yet"

# Do a build, and now the sync should have happened and the build dir be filled
run_alr("build")
base = builds.find_dir("hello_1.0.1_filesystem")
base = builds.find_dir("hello")

# There's too much object files and the like, check a few critical files:
files = contents(base) # This returns "normalized" paths (with '/' separators)
Expand Down

0 comments on commit 845766d

Please sign in to comment.