Skip to content

Commit

Permalink
more testing
Browse files Browse the repository at this point in the history
  • Loading branch information
rmoreliovlabs committed Sep 24, 2024
1 parent 833fd18 commit 8ee53f4
Showing 1 changed file with 11 additions and 36 deletions.
47 changes: 11 additions & 36 deletions .github/workflows/rit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,13 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout Repository # Step needed to access the PR description using github CLI
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Checkout Repository
uses: actions/checkout@v2
with:
repository: ${{ github.event.pull_request.head.repo.full_name }} # Use the forked repo
ref: ${{ github.head_ref }} # Checkout the PR branch
fetch-depth: 0 # Fetch all history for all branches

- name: Confirm Checkout
run: |
echo "Current branch: $(git branch --show-current)"
git ls-tree -r HEAD --name-only
repository: ${{ github.repository }} # Use the forked repository
ref: ${{ github.head_ref }}
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set Branch Variables
id: set-branch-variables
Expand All @@ -42,46 +38,35 @@ jobs:
github_event_name: ${{ github.event_name }}
github_event_pull_request_number: ${{ github.event.pull_request.number }}
github_head_ref: ${{ github.head_ref }}
github_ref_name: ${{ github.ref_name }}
run: |
PR_DESCRIPTION=pr-description.txt
ALLOWED_BRANCH_CHARACTERS='[-./0-9A-Z_a-z]'
default_rskj_branch=master
default_powpeg_branch=master
default_rit_branch=main
get_branch_from_description()
{
get_branch_from_description() {
_prefix=$1
# On lines matching "`$_prefix:...`", replace the lines with the
# thing in ... and print the result.
_search_re='\@`'$_prefix:$ALLOWED_BRANCH_CHARACTERS'\{1,\}`@'
_replace_re='s@.*`'$_prefix:'\('$ALLOWED_BRANCH_CHARACTERS'\{1,\}\)`.*@\1@p'
_branch=$(sed -n "$_search_re $_replace_re" "$PR_DESCRIPTION")
echo "$_branch"
}
is_valid_branch_name()
{
is_valid_branch_name() {
echo "$1" | grep -qx "$ALLOWED_BRANCH_CHARACTERS\\{1,\\}"
}
if [ "$github_event_name" = workflow_dispatch ]; then
RSKJ_BRANCH=$github_ref_name
POWPEG_BRANCH=${github_event_inputs_powpeg_branch:-$default_powpeg_branch}
RIT_BRANCH=${github_event_inputs_rit_branch:-$default_rit_branch}
RSKJ_BRANCH=$github_head_ref
POWPEG_BRANCH=${github_event_input_powpeg_branch:-$default_powpeg_branch}
RIT_BRANCH=${github_event_input_rit_branch:-$default_rit_branch}
elif [ "$github_event_name" = pull_request ]; then
gh pr view "$github_event_pull_request_number" --json body -q .body >"$PR_DESCRIPTION"
RSKJ_BRANCH=$(get_branch_from_description rskj)
: ${RSKJ_BRANCH:=${github_head_ref:-$default_rskj_branch}}
POWPEG_BRANCH=$(get_branch_from_description fed)
: ${POWPEG_BRANCH:=$default_powpeg_branch}
RIT_BRANCH=$(get_branch_from_description rit)
: ${RIT_BRANCH:=$default_rit_branch}
else
Expand Down Expand Up @@ -113,19 +98,9 @@ jobs:
BUILD_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
echo "BUILD_URL=$BUILD_URL" >> $GITHUB_ENV
- name: Sanitize Branch Name
id: sanitize-branch-name
env:
GITHUB_HEAD_REF: ${{ github.head_ref }}
run: |
# Delete non-alphanumeric characters and limit to 255 chars which is the branch limit in GitHub
SAFE_BRANCH_NAME=$(echo "${GITHUB_HEAD_REF}" | tr -cd '[:alnum:]_-' | cut -c1-255)
echo "SAFE_BRANCH_NAME=$SAFE_BRANCH_NAME" >> $GITHUB_ENV
- name: Run Rootstock Integration Tests
uses: rsksmart/rootstock-integration-tests@497172fd38dcfaf48c77f9bb1eeb6617eef5eed6 #v1
with:
rskj-branch: ${{ env.RSKJ_BRANCH }}
powpeg-node-branch: ${{ env.POWPEG_BRANCH }}
rit-branch: ${{ env.RIT_BRANCH }}

0 comments on commit 8ee53f4

Please sign in to comment.