From ad835c9c8fdece75daf04c9dd77e669288561202 Mon Sep 17 00:00:00 2001 From: "Oleg V. Kozlyuk" Date: Tue, 10 Dec 2024 23:18:05 +0100 Subject: [PATCH 1/9] Switching to composite actions, take 0 --- .github/actions/build.yml | 75 +++++++++++++++++++++++++++++++++++ .github/workflows/on-push.yml | 10 +++-- 2 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 .github/actions/build.yml diff --git a/.github/actions/build.yml b/.github/actions/build.yml new file mode 100644 index 000000000..12372f6a7 --- /dev/null +++ b/.github/actions/build.yml @@ -0,0 +1,75 @@ +name: "Hello World" +description: "Greet someone" +inputs: + architecture: + description: "Build Architecture" + default: x86 + type: string + +outputs: + random-number: + description: "Random number" + value: ${{ steps.random-number-generator.outputs.random-number }} + +runs: + using: "composite" + timeout-minutes: 60 + env: + DXSDK_DIR: "${{ github.workspace }}\\DXSDK" + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Problem Matcher + uses: ammaraskar/msvc-problem-matcher@master + + - name: Setup MSVC Console + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ inputs.architecture }} + + - name: Install documentation prerequisites + if: ${{ inputs.docs }} + shell: pwsh + run: | + choco install --no-progress miktex + choco install --no-progress doxygen.install + choco install --no-progress libreoffice-fresh + Add-Content $env:GITHUB_PATH "C:\Program Files\MiKTeX\miktex\bin\x64\" + + - name: Create directories + run: | + mkdir out\build + mkdir out\install + + - name: Cache irrKlang package + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/Extern/irrKlang/${{ inputs.architecture }} + key: irrKlang-${{ inputs.architecture }} + + - name: Cache DirectX SDK + id: cache + uses: actions/cache@v4 + with: + path: "${{ github.workspace }}\\DXSDK" + key: dxsdk_jun10 + + - name: Download DirectX SDK + if: steps.cache.outputs.cache-hit != 'true' + shell: cmd + run: | + curl -L https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe -o DXSDK_Jun10.exe + 7z x DXSDK_Jun10.exe DXSDK/Include + 7z x DXSDK_Jun10.exe DXSDK/Lib + del DXSDK_Jun10.exe + dir /S /B DXSDK + + - name: Configure + run: cmake . --preset windows-${{ inputs.architecture }}-release + -DORBITER_MAKE_DOC=${{ inputs.docs && 'ON' || 'OFF' }} + -DDXSDK_DIR:PATH="${{ github.workspace }}\\DXSDK" + + - name: Build + run: cmake --build --preset windows-${{ inputs.architecture }}-release --jobs 2 diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml index d182ee8e6..b1d52a193 100644 --- a/.github/workflows/on-push.yml +++ b/.github/workflows/on-push.yml @@ -18,7 +18,9 @@ jobs: matrix: architecture: [x64, x86] os: [windows-2022] - uses: ./.github/workflows/reusable-build.yml - with: - os: ${{ matrix.os }} - architecture: ${{ matrix.architecture }} + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: orbitersim/orbiter/.github/actions/build@main + with: + architecture: ${{ matrix.architecture }} From e0e5872bb970e8b3a4f929b0b8bc46216c6b2367 Mon Sep 17 00:00:00 2001 From: "Oleg V. Kozlyuk" Date: Tue, 10 Dec 2024 23:21:29 +0100 Subject: [PATCH 2/9] Various fixes --- .github/actions/build.yml | 75 ----------------------------------- .github/workflows/on-push.yml | 8 +++- 2 files changed, 6 insertions(+), 77 deletions(-) delete mode 100644 .github/actions/build.yml diff --git a/.github/actions/build.yml b/.github/actions/build.yml deleted file mode 100644 index 12372f6a7..000000000 --- a/.github/actions/build.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: "Hello World" -description: "Greet someone" -inputs: - architecture: - description: "Build Architecture" - default: x86 - type: string - -outputs: - random-number: - description: "Random number" - value: ${{ steps.random-number-generator.outputs.random-number }} - -runs: - using: "composite" - timeout-minutes: 60 - env: - DXSDK_DIR: "${{ github.workspace }}\\DXSDK" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Problem Matcher - uses: ammaraskar/msvc-problem-matcher@master - - - name: Setup MSVC Console - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: ${{ inputs.architecture }} - - - name: Install documentation prerequisites - if: ${{ inputs.docs }} - shell: pwsh - run: | - choco install --no-progress miktex - choco install --no-progress doxygen.install - choco install --no-progress libreoffice-fresh - Add-Content $env:GITHUB_PATH "C:\Program Files\MiKTeX\miktex\bin\x64\" - - - name: Create directories - run: | - mkdir out\build - mkdir out\install - - - name: Cache irrKlang package - uses: actions/cache@v4 - with: - path: ${{ github.workspace }}/Extern/irrKlang/${{ inputs.architecture }} - key: irrKlang-${{ inputs.architecture }} - - - name: Cache DirectX SDK - id: cache - uses: actions/cache@v4 - with: - path: "${{ github.workspace }}\\DXSDK" - key: dxsdk_jun10 - - - name: Download DirectX SDK - if: steps.cache.outputs.cache-hit != 'true' - shell: cmd - run: | - curl -L https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe -o DXSDK_Jun10.exe - 7z x DXSDK_Jun10.exe DXSDK/Include - 7z x DXSDK_Jun10.exe DXSDK/Lib - del DXSDK_Jun10.exe - dir /S /B DXSDK - - - name: Configure - run: cmake . --preset windows-${{ inputs.architecture }}-release - -DORBITER_MAKE_DOC=${{ inputs.docs && 'ON' || 'OFF' }} - -DDXSDK_DIR:PATH="${{ github.workspace }}\\DXSDK" - - - name: Build - run: cmake --build --preset windows-${{ inputs.architecture }}-release --jobs 2 diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml index b1d52a193..c11d3930e 100644 --- a/.github/workflows/on-push.yml +++ b/.github/workflows/on-push.yml @@ -20,7 +20,11 @@ jobs: os: [windows-2022] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - uses: orbitersim/orbiter/.github/actions/build@main + - name: Checkout + uses: actions/checkout@v4 + + - name: Build + uses: orbitersim/orbiter/.github/actions/build@main + timeout-minutes: 60 with: architecture: ${{ matrix.architecture }} From 95df1e4d3a56db2237d8be252f0c9c590eeb9a07 Mon Sep 17 00:00:00 2001 From: "Oleg V. Kozlyuk" Date: Wed, 11 Dec 2024 00:04:56 +0100 Subject: [PATCH 3/9] Various fixes --- .github/workflows/on-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml index c11d3930e..293efba00 100644 --- a/.github/workflows/on-push.yml +++ b/.github/workflows/on-push.yml @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v4 - name: Build - uses: orbitersim/orbiter/.github/actions/build@main + uses: ./.github/actions/build timeout-minutes: 60 with: architecture: ${{ matrix.architecture }} From c33e89ad49a8216c2b4b91c57249d64e4f1d835c Mon Sep 17 00:00:00 2001 From: "Oleg V. Kozlyuk" Date: Wed, 11 Dec 2024 00:09:17 +0100 Subject: [PATCH 4/9] Try ls? --- .github/workflows/on-push.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml index 293efba00..7247f02fd 100644 --- a/.github/workflows/on-push.yml +++ b/.github/workflows/on-push.yml @@ -23,6 +23,8 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - run: ls ./.github/actions/build + - name: Build uses: ./.github/actions/build timeout-minutes: 60 From 05eda37a1276924f307526b2bfcab352a4e4296a Mon Sep 17 00:00:00 2001 From: "Oleg V. Kozlyuk" Date: Wed, 11 Dec 2024 00:11:20 +0100 Subject: [PATCH 5/9] Try dir? --- .github/workflows/on-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml index 7247f02fd..f8b1f6a97 100644 --- a/.github/workflows/on-push.yml +++ b/.github/workflows/on-push.yml @@ -23,7 +23,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - run: ls ./.github/actions/build + - run: dir /S /B - name: Build uses: ./.github/actions/build From 25d2c11e343b28a332d67b86caef6ad4009fd89a Mon Sep 17 00:00:00 2001 From: "Oleg V. Kozlyuk" Date: Wed, 11 Dec 2024 00:14:22 +0100 Subject: [PATCH 6/9] Use cmd --- .github/workflows/on-push.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml index f8b1f6a97..d2fff4242 100644 --- a/.github/workflows/on-push.yml +++ b/.github/workflows/on-push.yml @@ -24,6 +24,7 @@ jobs: uses: actions/checkout@v4 - run: dir /S /B + shell: cmd - name: Build uses: ./.github/actions/build From 79f04c9ea2d1f7bc1570414ead7437aa640d2788 Mon Sep 17 00:00:00 2001 From: "Oleg V. Kozlyuk" Date: Wed, 11 Dec 2024 00:36:19 +0100 Subject: [PATCH 7/9] Add a 2nd copy of action --- .github/workflows/on-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml index d2fff4242..ec953f3b0 100644 --- a/.github/workflows/on-push.yml +++ b/.github/workflows/on-push.yml @@ -27,7 +27,7 @@ jobs: shell: cmd - name: Build - uses: ./.github/actions/build + uses: ./.actions/build timeout-minutes: 60 with: architecture: ${{ matrix.architecture }} From 8eb5d5a2fd7e67d00e28b5d2e82ee925a8990c7b Mon Sep 17 00:00:00 2001 From: "Oleg V. Kozlyuk" Date: Wed, 11 Dec 2024 00:40:34 +0100 Subject: [PATCH 8/9] Fixed file which is missing for some reason --- .github/actions/build/action.yml | 68 ++++++++++++++++++++++++++++++++ .github/workflows/on-push.yml | 2 +- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 .github/actions/build/action.yml diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml new file mode 100644 index 000000000..12a4610c6 --- /dev/null +++ b/.github/actions/build/action.yml @@ -0,0 +1,68 @@ +name: "Hello World" +description: "Greet someone" +inputs: + architecture: + description: "Build Architecture" + default: x86 + +outputs: + random-number: + description: "Random number" + value: ${{ steps.random-number-generator.outputs.random-number }} + +runs: + using: "composite" + + steps: + - name: Setup Problem Matcher + uses: ammaraskar/msvc-problem-matcher@master + + - name: Setup MSVC Console + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ inputs.architecture }} + + - name: Install documentation prerequisites + if: ${{ inputs.docs }} + shell: pwsh + run: | + choco install --no-progress miktex + choco install --no-progress doxygen.install + choco install --no-progress libreoffice-fresh + Add-Content $env:GITHUB_PATH "C:\Program Files\MiKTeX\miktex\bin\x64\" + + - name: Create directories + run: | + mkdir out\build + mkdir out\install + + - name: Cache irrKlang package + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/Extern/irrKlang/${{ inputs.architecture }} + key: irrKlang-${{ inputs.architecture }} + + - name: Cache DirectX SDK + id: cache + uses: actions/cache@v4 + with: + path: "${{ github.workspace }}\\DXSDK" + key: dxsdk_jun10 + + - name: Download DirectX SDK + if: steps.cache.outputs.cache-hit != 'true' + shell: cmd + run: | + curl -L https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe -o DXSDK_Jun10.exe + 7z x DXSDK_Jun10.exe DXSDK/Include + 7z x DXSDK_Jun10.exe DXSDK/Lib + del DXSDK_Jun10.exe + dir /S /B DXSDK + + - name: Configure + run: cmake . --preset windows-${{ inputs.architecture }}-release + -DORBITER_MAKE_DOC=${{ inputs.docs && 'ON' || 'OFF' }} + -DDXSDK_DIR:PATH="${{ github.workspace }}\\DXSDK" + + - name: Build + run: cmake --build --preset windows-${{ inputs.architecture }}-release --jobs 2 diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml index ec953f3b0..d2fff4242 100644 --- a/.github/workflows/on-push.yml +++ b/.github/workflows/on-push.yml @@ -27,7 +27,7 @@ jobs: shell: cmd - name: Build - uses: ./.actions/build + uses: ./.github/actions/build timeout-minutes: 60 with: architecture: ${{ matrix.architecture }} From 8886d0d5a8a516e426db6c395e7b2217c8366d1b Mon Sep 17 00:00:00 2001 From: "Oleg V. Kozlyuk" Date: Wed, 11 Dec 2024 00:43:51 +0100 Subject: [PATCH 9/9] Added missing shell: expressions --- .github/actions/build/action.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 12a4610c6..db4908b11 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -4,6 +4,9 @@ inputs: architecture: description: "Build Architecture" default: x86 + docs: + description: Build documentation? + default: OFF outputs: random-number: @@ -23,7 +26,7 @@ runs: arch: ${{ inputs.architecture }} - name: Install documentation prerequisites - if: ${{ inputs.docs }} + if: ${{ inputs.docs == 'ON' }} shell: pwsh run: | choco install --no-progress miktex @@ -32,6 +35,7 @@ runs: Add-Content $env:GITHUB_PATH "C:\Program Files\MiKTeX\miktex\bin\x64\" - name: Create directories + shell: cmd run: | mkdir out\build mkdir out\install @@ -60,9 +64,11 @@ runs: dir /S /B DXSDK - name: Configure + shell: cmd run: cmake . --preset windows-${{ inputs.architecture }}-release - -DORBITER_MAKE_DOC=${{ inputs.docs && 'ON' || 'OFF' }} + -DORBITER_MAKE_DOC=${{ inputs.docs }} -DDXSDK_DIR:PATH="${{ github.workspace }}\\DXSDK" - name: Build + shell: cmd run: cmake --build --preset windows-${{ inputs.architecture }}-release --jobs 2