Skip to content

Commit

Permalink
update workflow to build template on dependabot prs
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Dec 18, 2024
1 parent 8c4c76b commit 36f33ee
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
6 changes: 6 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,7 @@ runs:
echo "link-azle=true" >> $GITHUB_OUTPUT
fi
echo "fuzz=false" >> $GITHUB_OUTPUT
echo "is-dependabot=${{ github.actor == 'dependabot[bot]' }}" >> $GITHUB_OUTPUT
fi
- id: echo-outputs
Expand All @@ -80,3 +85,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 }}"
38 changes: 37 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
exclude-release-only: ${{ steps.determine-workflow-config.outputs.exclude-release-only }}
link-azle: ${{ steps.determine-workflow-config.outputs.link-azle }}
fuzz: ${{ steps.determine-workflow-config.outputs.fuzz }}
is-dependabot: ${{ steps.determine-workflow-config.outputs.is-dependabot }}
steps:
- uses: actions/checkout@v4

Expand All @@ -66,9 +67,44 @@ jobs:
link-azle-dispatch-input-value: ${{ inputs.link-azle }}
fuzz-dispatch-input-value: ${{ inputs.fuzz }}

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 }}

get-exclude-dirs:
name: Get exclude directories
needs: workflow-config
needs:
- workflow-config
- build-templates
runs-on: ubuntu-latest
outputs:
exclude-dirs: ${{ steps.get-exclude-dirs.outputs.exclude-dirs }}
Expand Down

0 comments on commit 36f33ee

Please sign in to comment.