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

feat(ci): allow running netsim from another branch #1186

Merged
merged 4 commits into from
Jul 10, 2023
Merged
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
15 changes: 14 additions & 1 deletion .github/workflows/netsim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,24 @@ jobs:
run: |
cargo build --profile optimized-release --workspace --all-features

- name: Detect chuck branch
if: github.event_name == 'issue_comment'
id: detect_chuck_branch
run: |
a='${{ github.event.comment.body }}'
branch="main"
if [[ $a == '/netsim branch'* ]];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the entire comment body must be only /netsim branch <branch_name> and nothing more?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory you can add random stuff beyond but it only matches the 1st 2 parts for the propper branching and the 3rd for the value, rest is ignored.

then
a=$(echo "$a" | tr '\n' ' ' | tr -s " " | cut -d ' ' -f3)
branch="$a"
fi
echo "CHUCK_BRANCH=$branch" >> ${GITHUB_ENV}

- name: Fetch and build chuck
run: |
cd ..
rm -rf chuck
git clone https://github.com/n0-computer/chuck.git
git clone --single-branch --branch ${{ env.CHUCK_BRANCH }} https://github.com/n0-computer/chuck.git
cd chuck
cargo build --release

Expand Down
Loading