Skip to content

Commit

Permalink
Merge pull request #2347 from demergent-labs/dep_bot
Browse files Browse the repository at this point in the history
update workflow to build template on dependabot prs
  • Loading branch information
lastmjs authored Dec 18, 2024
2 parents 23a7e8f + c61df5d commit 92ea2d9
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/actions/determine_workflow_config/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ outputs:
fuzz:
description: 'Whether to run fuzz tests'
value: ${{ steps.determine_workflow_config.outputs.fuzz }}
is-dependabot:
description: 'Whether the commit is from Dependabot'
value: ${{ steps.determine_workflow_config.outputs.is-dependabot }}

runs:
using: 'composite'
Expand All @@ -54,6 +57,7 @@ runs:
echo "exclude-release-only=${{ inputs.exclude-release-only-dispatch-input-value }}" >> $GITHUB_OUTPUT
echo "link-azle=${{ inputs.link-azle-dispatch-input-value }}" >> $GITHUB_OUTPUT
echo "fuzz=${{ inputs.fuzz-dispatch-input-value }}" >> $GITHUB_OUTPUT
echo "is-dependabot=false" >> $GITHUB_OUTPUT
else
EXCLUDE_SLOW=${{ steps.workflow-context.outputs.is_feature_branch_draft_pr == 'true' }}
EXCLUDE_UNSTABLE=${{ steps.workflow-context.outputs.is_feature_branch_draft_pr == 'true' || steps.workflow-context.outputs.is_feature_branch_pr == 'true' }}
Expand All @@ -69,6 +73,8 @@ runs:
echo "link-azle=true" >> $GITHUB_OUTPUT
fi
echo "fuzz=false" >> $GITHUB_OUTPUT
echo ${{ github.actor }}
echo "is-dependabot=${{ github.actor == 'dependabot[bot]' }}" >> $GITHUB_OUTPUT
fi
- id: echo-outputs
Expand All @@ -80,3 +86,4 @@ runs:
echo "exclude-release-only: ${{ steps.determine_workflow_config.outputs.exclude-release-only }}"
echo "link-azle: ${{ steps.determine_workflow_config.outputs.link-azle }}"
echo "fuzz: ${{ steps.determine_workflow_config.outputs.fuzz }}"
echo "is-dependabot: ${{ steps.determine_workflow_config.outputs.is-dependabot }}"
60 changes: 60 additions & 0 deletions .github/workflows/build_templates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build Templates

on:
pull_request:
types:
- opened
- synchronize
- ready_for_review
- reopened

jobs:
workflow-config:
name: Determine workflow config
runs-on: ubuntu-latest
outputs:
is-dependabot: ${{ steps.determine-workflow-config.outputs.is-dependabot }}
steps:
- uses: actions/checkout@v4

- id: determine-workflow-config
uses: ./.github/actions/determine_workflow_config
with:
is-workflow-dispatch: false
exclude-slow-dispatch-input-value: false
exclude-unstable-dispatch-input-value: false
exclude-release-only-dispatch-input-value: false
link-azle-dispatch-input-value: false

build-templates:
name: Build templates for Dependabot
needs: workflow-config
if: ${{ needs.workflow-config.outputs.is-dependabot == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.LASTMJS_GITHUB_TOKEN }}

- uses: ./.github/actions/setup_node

- uses: ./.github/actions/setup_dfx

- run: npm install

- name: Install global dependencies
run: |
AZLE_VERBOSE=true npx azle install-global-dependencies --rust --wasi2ic
- name: Build stable template
run: AZLE_VERBOSE=true npx azle template

- name: Build experimental template
run: AZLE_VERBOSE=true npx azle template --experimental

- uses: ./.github/actions/commit_and_push
with:
branch-name: ${{ github.head_ref }}
commit-message: 'chore: update templates for dependency changes'
gpg_signing_key: ${{ secrets.GPG_SIGNING_KEY }}

0 comments on commit 92ea2d9

Please sign in to comment.