From 8b9ad779f5d3c23a60256302e72097d9865ec8fa Mon Sep 17 00:00:00 2001 From: Evgeny Gorodetsky Date: Sat, 14 Oct 2023 21:19:53 +0300 Subject: [PATCH] Fix Linux build and origin repository detection in CI Build --- .github/workflows/ci-build.yml | 14 ++++++++------ .github/workflows/ci-codeql-scan.yml | 4 +++- .github/workflows/ci-sonar-scan.yml | 4 +++- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 18ed06105..597e10c80 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -35,7 +35,7 @@ env: product_ver_build: ${{ github.run_number }} tracy_release_version: "0.9.1" vulkan_sdk_version: "1.3.250.1" - is_origin_repository: ${{ github.repository == 'MethanePowered/MethaneKit' }} + origin_repository: 'MethanePowered/MethaneKit' # TSC Invariant check is disabled to allow running Catch test executables only for tests list query by CTest TRACY_NO_INVARIANT_CHECK: 1 @@ -207,13 +207,15 @@ jobs: - name: Install Linux prerequisites if: ${{ matrix.os_name == 'Ubuntu' }} - run: sudo apt install xcb libx11-dev libx11-xcb-dev libxcb-sync-dev libxcb-randr0-dev p7zip + run: + sudo apt update + sudo apt install xcb libx11-dev libx11-xcb-dev libxcb-sync-dev libxcb-randr0-dev p7zip - name: Checkout repository uses: actions/checkout@v3 - name: Install Testspace - if: ${{ env.is_origin_repository }} + if: ${{ github.repository == env.origin_repository }} uses: testspace-com/setup-testspace@v1 with: domain: ${{ github.repository_owner }} @@ -316,7 +318,7 @@ jobs: path: ${{ env.INSTALL_DIR }}/Tests/*_result.xml - name: Upload Test Results and Build Log to Testspace server - if: ${{ env.is_origin_repository && matrix.run_tests && (success() || failure()) }} + if: ${{ github.repository == env.origin_repository && matrix.run_tests && (success() || failure()) }} run: testspace "[ ${{ matrix.name }} ]${{ env.INSTALL_DIR }}/Tests/*_result.xml" "[ ${{ matrix.name }} ]${{ env.BUILD_LOG_FILE }}" - name: Add README and BUILD files @@ -361,7 +363,7 @@ jobs: - name: Update Badge Parameters id: badge-params - if: ${{ env.is_origin_repository && github.event_name == 'push' && always() }} + if: ${{ github.repository == env.origin_repository && github.event_name == 'push' && always() }} shell: bash run: | case "${{ job.status }}" in @@ -384,7 +386,7 @@ jobs: esac - name: Update Badge JSON - if: ${{ env.is_origin_repository && github.event_name == 'push' && always() }} + if: ${{ github.repository == env.origin_repository && github.event_name == 'push' && always() }} uses: schneegans/dynamic-badges-action@v1.6.0 # https://github.com/marketplace/actions/dynamic-badges with: auth: ${{ secrets.GIST_TOKEN }} diff --git a/.github/workflows/ci-codeql-scan.yml b/.github/workflows/ci-codeql-scan.yml index d84d34b5a..c4fc29ab4 100644 --- a/.github/workflows/ci-codeql-scan.yml +++ b/.github/workflows/ci-codeql-scan.yml @@ -62,7 +62,9 @@ jobs: - name: Install Linux prerequisites if: ${{ matrix.os == 'ubuntu-latest' }} - run: sudo apt install xcb libx11-dev libx11-xcb-dev libxcb-sync-dev libxcb-randr0-dev + run: + sudo apt update + sudo apt install xcb libx11-dev libx11-xcb-dev libxcb-sync-dev libxcb-randr0-dev - name: Checkout repository uses: actions/checkout@v3 diff --git a/.github/workflows/ci-sonar-scan.yml b/.github/workflows/ci-sonar-scan.yml index d1a31b762..717b7a069 100644 --- a/.github/workflows/ci-sonar-scan.yml +++ b/.github/workflows/ci-sonar-scan.yml @@ -98,7 +98,9 @@ jobs: - name: Install Linux prerequisites if: ${{ matrix.os_name == 'linux' }} - run: sudo apt install xcb libx11-dev libx11-xcb-dev libxcb-sync-dev libxcb-randr0-dev lcov + run: + sudo apt update + sudo apt install xcb libx11-dev libx11-xcb-dev libxcb-sync-dev libxcb-randr0-dev lcov - name: Install Testspace uses: testspace-com/setup-testspace@v1