From daea620b6af7a167081c0ceddd82e60b72d316c3 Mon Sep 17 00:00:00 2001 From: Joey Vagedes Date: Tue, 24 Oct 2023 10:33:25 -0700 Subject: [PATCH 1/2] test_prepare.py: rename duplicate filename Renames `DefaultPk.bin` to `DefaultDbx.bin` due to the fact that using `DefaultPk.bin` and `DefaultPK.bin` would result in different file counts on Linux and Windows due to Linux treating files with different capitalizations as different files and windows not. --- scripts/test_prepare.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/test_prepare.py b/scripts/test_prepare.py index a119ba9..bc81638 100644 --- a/scripts/test_prepare.py +++ b/scripts/test_prepare.py @@ -23,7 +23,7 @@ def test_layout(tmpdir: pathlib.Path) -> None: artifacts.mkdir() folder_list = ["Arm", "Aarch64", "Ia32", "X64"] - file_list = ["Default3PDb.bin", "DefaultDb.bin", "DefaultKEK.bin", "DefaultPK.bin", "DefaultPk.bin", "README.md"] + file_list = ["Default3PDb.bin", "DefaultDb.bin", "DefaultDbx.bin", "DefaultKEK.bin", "DefaultPK.bin", "README.md"] for folder in folder_list: folder = artifacts / folder @@ -45,11 +45,10 @@ def test_layout(tmpdir: pathlib.Path) -> None: zip_file_list = list(pathlib.Path(tmpdir / OUT_FILE).glob("*")) - assert len(zip_file_list) == 8 for file in zip_file_list: with tempfile.TemporaryDirectory() as temp_unzip_dir: shutil.unpack_archive(file, temp_unzip_dir) - assert len(list(pathlib.Path(temp_unzip_dir).glob("*"))) == 6 + assert len(list(pathlib.Path(temp_unzip_dir).glob("*"))) == 7 From f7f8f0e11614b4539c3fb79911f19e3126550b11 Mon Sep 17 00:00:00 2001 From: Joey Vagedes Date: Tue, 24 Oct 2023 10:51:47 -0700 Subject: [PATCH 2/2] prepare-binaries.yml: switch to pull_request Switch to pull_request when running unit tests, so that tests are run against the actual changes in the codebase. Continue to use pull_request_target when performing a release. --- .github/workflows/prepare-binaries.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prepare-binaries.yml b/.github/workflows/prepare-binaries.yml index c2998eb..93ffd29 100644 --- a/.github/workflows/prepare-binaries.yml +++ b/.github/workflows/prepare-binaries.yml @@ -15,7 +15,7 @@ name: Prepare Secure Boot Binaries on: push: branches: [ "main" ] - pull_request_target: + pull_request: branches: [ "main" ] release: types: [published]