Create PR to update bindings #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create PR to update bindings | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 1 */2 *' | |
jobs: | |
install-vitasdk: | |
uses: ./.github/workflows/setup-vitasdk.yml | |
with: | |
path: /opt/vitasdk | |
update-and-regenrate: | |
name: Update and regenerate | |
runs-on: ubuntu-latest | |
needs: install-vitasdk | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Restore vitasdk cache | |
uses: actions/cache/restore@v3 | |
with: | |
path: /opt/vitasdk | |
key: ${{ runner.os }}-vitasdk | |
fail-on-cache-miss: true | |
- name: Cache LLVM and Clang | |
id: cache-llvm | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ runner.temp }}/llvm | |
key: llvm | |
- name: Install LLVM and Clang | |
uses: KyleMayes/install-llvm-action@v1 | |
with: | |
version: "14" | |
directory: ${{ runner.temp }}/llvm | |
cached: ${{ steps.cache-llvm.outputs.cache-hit }} | |
- name: Cache generator depenedencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
generator/target/ | |
key: ${{ runner.os }}-cargo-generator-${{ hashFiles('generator/Cargo.lock') }} | |
- name: Update vita-headers | |
run: | | |
echo "VITA_HEADERS_HASH=$(git submodule status | grep generator/vita-headers | cut -d ' ' -f 2)" >> $GITHUB_ENV | |
git submodule update --recursive --remote generator/vita-headers | |
- name: Regenerate bindings | |
env: | |
VITASDK: /opt/vitasdk | |
# From clang-sys | |
LIBCLANG_PATH: ${{ runner.temp }}/llvm/lib | |
LLVM_CONFIG_PATH: ${{ runner.temp }}/llvm/bin/llvm-config | |
run: | | |
cd generator | |
cargo run | |
cd .. | |
cargo fmt | |
- name: Commit and create pull request | |
id: create-pull-request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
title: Update vita-headers bindings | |
body: Created by the action at [/.workflows/update-bindings.yml](../tree/main/.workflows/update-bindings.yml) | |
branch: update-bindings | |
delete-branch: true | |
commit-message: Update vita-headers to ${{ env.VITA_HEADERS_HASH }} | |
assignees: pheki | |
- name: Trigger build | |
env: | |
# Required by Github CLI (`gh`) | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
gh workflow run build-example.yml --ref update-bindings |