From 8be8c94eb55b774cc7e40547cb0a630308fce9ad Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Tue, 21 Sep 2021 11:05:25 +0200 Subject: [PATCH 1/2] ci: Add .github/workflows/update-header-pr.yml --- .github/workflows/update-header-pr.yml | 59 ++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/update-header-pr.yml diff --git a/.github/workflows/update-header-pr.yml b/.github/workflows/update-header-pr.yml new file mode 100644 index 0000000..ab91ed0 --- /dev/null +++ b/.github/workflows/update-header-pr.yml @@ -0,0 +1,59 @@ +name: CI Ubuntu + +on: + schedule: + - cron: '0 0 * * *' # every day at midnight + +jobs: + update-vulkan-headers: + runs-on: ubuntu-latest + + strategy: + matrix: + build_type: [Debug] + cxx_compiler: [g++-9] + cxx_standard: [11] + + steps: + - uses: actions/checkout@v2 + + - name: Install libraries + run: sudo apt install clang-format-12 + + - name: Update Submodules + run: | + git submodule update --init --recursive + cd Vulkan-Headers + VK_HEADER_GIT_TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) + git checkout $VK_HEADER_GIT_TAG + echo "VK_HEADER_GIT_TAG=$VK_HEADER_GIT_TAG" >> $GITHUB_ENV + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build + -DSAMPLES_BUILD=OFF + -DTESTS_BUILD=OFF + -DVULKAN_HPP_RUN_GENERATOR=ON + -DCMAKE_CXX_COMPILER=${{matrix.cxx_compiler}} + -DCMAKE_CXX_STANDARD=${{matrix.cxx_standard}} + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} + + - name: Commit changes + run: | + git config user.name "GitHub" + git config user.email "noreply@github.com" + git add Vulkan-Headers vulkan + rm -rf build + git commit -m "Update Vulkan-Headers to $VK_HEADER_GIT_TAG" || echo 'No commit necessary!' + git clean -xf + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + with: + commit-message: Update Vulkan-Headers to ${{ env.VK_HEADER_GIT_TAG }} + title: Update Vulkan-Headers to ${{ env.VK_HEADER_GIT_TAG }} + branch: update-vulkan-headers-pr + base: ${{ github.head_ref }} + body: | + Please close and open this PR to trigger the CI! From 9f6892513de351e17127a68dc583267796fd406b Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Tue, 21 Sep 2021 19:40:35 +0200 Subject: [PATCH 2/2] ci: set tag for Vulkan-Headers if non-existing --- .github/workflows/set-version-tag.yml | 28 ++++++++++++++++++++++++++ .github/workflows/update-header-pr.yml | 4 ++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/set-version-tag.yml diff --git a/.github/workflows/set-version-tag.yml b/.github/workflows/set-version-tag.yml new file mode 100644 index 0000000..270fcf1 --- /dev/null +++ b/.github/workflows/set-version-tag.yml @@ -0,0 +1,28 @@ +name: Set Version Tag + +on: + push: + branches: ["master"] + +jobs: + set-version-tag: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Update Submodules + run: | + git submodule update --init --recursive + cd Vulkan-Headers + VK_HEADER_GIT_TAG=$(git tag --points-at HEAD | head -n1) + git checkout $VK_HEADER_GIT_TAG + echo "VK_HEADER_GIT_TAG=$VK_HEADER_GIT_TAG" >> $GITHUB_ENV + + - name: Set Tag + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git + git tag $VK_HEADER_GIT_TAG || echo "Failed to set tag. Already existing?" + git push -u origin $VK_HEADER_GIT_TAG || echo "Failed to push tag. Already existing?" diff --git a/.github/workflows/update-header-pr.yml b/.github/workflows/update-header-pr.yml index ab91ed0..dc63954 100644 --- a/.github/workflows/update-header-pr.yml +++ b/.github/workflows/update-header-pr.yml @@ -1,4 +1,4 @@ -name: CI Ubuntu +name: Update Vulkan-Headers PR on: schedule: @@ -56,4 +56,4 @@ jobs: branch: update-vulkan-headers-pr base: ${{ github.head_ref }} body: | - Please close and open this PR to trigger the CI! + Please close and reopen this PR to trigger the CI!