Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update workflow to build template on dependabot prs #2347

Merged
merged 5 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
Loading