Nelder Mead optimization for components, webpage and qrcode generation, and other #86
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Yeast genealogy preview | |
# Branch genealogy-preview must exist for this action to work. | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
workflow_dispatch: | |
jobs: | |
build_plots_and_publish: | |
if: "! github.event.pull_request.head.repo.fork " # If pull request is Not from Fork | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
COMMIT_SHA: ${{ github.event.pull_request.head.sha }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install Graphviz | |
run: sudo apt-get install -y graphviz | |
- name: Wait for other instances to complete | |
uses: softprops/turnstyle@v1 | |
with: | |
poll-interval-seconds: 10 | |
- name: Generate, Commit and Push genealogy plot | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git fetch | |
TARGET_BRANCH="${{ github.event.pull_request.base.ref }}" | |
IMAGE_NAME="genealogy-${COMMIT_SHA}-${TARGET_BRANCH}.png" | |
cargo run --verbose | |
cat output/genealogy.dot | dot -Tpng > output/genealogy.png | |
cp output/genealogy.png ../genealogy.png | |
git restore . | |
git switch genealogy-preview | |
cp ../genealogy.png ${IMAGE_NAME} | |
git add ${IMAGE_NAME} | |
git commit --allow-empty -m "Yeast genealogy preview action" | |
git push origin HEAD:genealogy-preview | |
- name: Publish genealogy plot | |
run: | | |
TARGET_BRANCH="${{ github.event.pull_request.base.ref }}" | |
IMAGE_NAME="genealogy-${COMMIT_SHA}-${TARGET_BRANCH}.png" | |
IMAGE_URL="https://raw.githubusercontent.com/${{ github.repository }}/genealogy-preview/${IMAGE_NAME}" | |
COMMIT_URL="https://github.com/${{ github.repository }}/commit/${COMMIT_SHA}" | |
COMMENT="Building using data from commit [${COMMIT_SHA}](${COMMIT_URL})\nGenerated image: [${IMAGE_URL}](${IMAGE_URL})\n![Generated Image](${IMAGE_URL})" | |
COMMENT_URL=$(jq -r .pull_request.comments_url "$GITHUB_EVENT_PATH") | |
curl -H "Authorization: token $GITHUB_TOKEN" -H "Content-Type: application/json" -X POST --data "{\"body\": \"$COMMENT\"}" "$COMMENT_URL" |