Skip to content

Snapshot integration node engine #29

Snapshot integration node engine

Snapshot integration node engine #29

name: Update Snapshots
on:
workflow_dispatch:
pull_request:
jobs:
update-snapshots:
name: Update Snapshots
runs-on: pub-hk-ubuntu-24.04-ip
steps:
- uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ vars.LINGUIST_GH_APP_ID }}
private-key: ${{ secrets.LINGUIST_GH_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v4
- name: Install musl-tools
run: sudo apt-get install musl-tools -y --no-install-recommends
- name: Update Rust toolchain
run: rustup update
- name: Install Rust linux-musl target
run: rustup target add x86_64-unknown-linux-musl
- name: Rust Cache
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
- name: Install cargo-insta
run: cargo install cargo-insta
- name: Install Pack CLI
uses: buildpacks/github-actions/setup-pack@d82294e03fd6b8e8484cde2ee166788876e366e3 #v5.8.10
- name: Pull builder image
run: docker pull heroku/builder:24
- name: Pull run image
run: |
RUN_IMAGE=$(
docker inspect --format='{{index .Config.Labels "io.buildpacks.builder.metadata"}}' 'heroku/builder:24' \
| jq --exit-status --raw-output '.stack.runImage.image'
)
docker pull "${RUN_IMAGE}"
- name: Rebuild integration test snapshots
env:
# This seems to be required because CI=true changes the behavior of how `cargo insta` treats various flags
# and setting CI=false allows the tests to run without fail in GHA to update the necessary snapshots.
CI: false
run: |
cargo insta test \
--accept \
--force-update-snapshots \
--test integration_test \
--package heroku-nodejs-engine-buildpack \
-- --ignored
- name: Create Pull Request
id: pr
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.generate-token.outputs.token }}
title: "Update Snapshots"
commit-message: "Update Node.js CNB snapshots"
committer: ${{ vars.LINGUIST_GH_APP_USERNAME }} <${{ vars.LINGUIST_GH_APP_EMAIL }}>
author: ${{ vars.LINGUIST_GH_APP_USERNAME }} <${{ vars.LINGUIST_GH_APP_EMAIL }}>
branch: update-snapshots
body: "Automated pull-request to update Node.js CNB snapshots"
- name: Configure PR
if: steps.pr.outputs.pull-request-operation == 'created'
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: gh pr merge --squash --auto "${{ steps.pr.outputs.pull-request-number }}"