Update api spec #177
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
on: | |
pull_request: | |
paths: | |
- spec.json | |
- .github/workflows/make-generate.yml | |
- VERSION.txt | |
name: make-generate | |
permissions: | |
packages: read | |
contents: write | |
jobs: | |
makegenerate: | |
# Check if the PR is not from a fork | |
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | |
name: make generate | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: Install latest stable/nightly | |
shell: bash | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y | |
rustup default nightly | |
rustup default stable | |
rustup component add rustfmt | |
rustup component add rustfmt --toolchain nightly | |
rustup component add clippy | |
echo PATH="${HOME}/.cargo/bin:${PATH}" >> ${GITHUB_ENV} | |
- name: Cache cargo registry | |
uses: actions/[email protected] | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo index | |
uses: actions/[email protected] | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo build | |
uses: actions/[email protected] | |
with: | |
path: target | |
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | |
- uses: taiki-e/install-action@nextest | |
- name: Run make generate | |
run: | | |
export EXPECTORATE=overwrite | |
make generate | |
env: | |
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}} | |
shell: bash | |
- name: Check for modified files | |
id: git-check | |
run: echo ::set-output name=modified::$(if git diff-index --ignore-submodules --quiet HEAD --; then echo "false"; else echo "true"; fi) | |
- name: Commit changes, if any | |
if: steps.git-check.outputs.modified == 'true' | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git | |
git add . | |
git commit -am "I have generated the library!" | |
git fetch origin | |
git rebase origin/${{github.event.pull_request.head.ref }} || true | |
git push origin ${{github.event.pull_request.head.ref }} |