[ci] main will skip upgrade tests for commits names [breaking] #17
Workflow file for this run
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: rust ci | |
on: | |
push: | |
tags: | |
- "[0-9]+.[0-9]+.[0-9]+" | |
- "[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+" | |
branches: ["**"] # glob pattern to allow slash / | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
branches: | |
- "release**" | |
- "main**" | |
schedule: | |
- cron: "30 00 * * *" | |
env: | |
DIEM_FORGE_NODE_BIN_PATH: ${{github.workspace}}/diem-node | |
LIBRA_CI: 1 | |
MODE_0L: "TESTNET" | |
jobs: | |
upgrades: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
# NOTE: for debugging CI this allow shell access to github runner. Will print out tmate.io terminal url | |
- name: Setup tmate session | |
uses: mxschmitt/action-tmate@v3 | |
with: | |
detached: true | |
timeout-minutes: 3 | |
# should always run unless we know and expect the upgrade to be breaking. In that case we wither explicitly name the branch with breaking, or the commit message as "[breaking]" (for example in the PR title) | |
- name: get commit message | |
run: | | |
echo LAST_COMMIT_MSG=$(git --no-pager log $GITHUB_SHA -n 1 --pretty=%B) >> ${GITHUB_ENV} | |
echo "LAST_COMMIT_MSG_ALT=$(git --no-pager show ${{github.event.pull_request.head.sha}} --pretty=%B)" >> ${GITHUB_ENV} | |
# better to do it in a new context so the env has been saved | |
- name: eval breaking | |
run: | | |
echo "COMMIT_BREAKING=${{contains(env.LAST_COMMIT_MSG_ALT, '[breaking]') || contains(env.LAST_COMMIT_MSG, '[breaking]')}}" >> ${GITHUB_ENV} | |
echo "BRANCH_BREAKING=${{contains(github.ref_name, 'breaking/') || contains(github.ref, 'breaking/') || contains(github.head_ref, 'breaking/')}}" >> ${GITHUB_ENV} | |
- name: sanity check vars | |
run: | | |
echo LAST_COMMIT_MSG: ${{ env.LAST_COMMIT_MSG }} | |
echo LAST_COMMIT_MSG_ALT: ${{ env.LAST_COMMIT_MSG_ALT }} | |
echo BRANCH_BREAKING: ${{ env.BRANCH_BREAKING }} | |
echo COMMIT_BREAKING: ${{ env.COMMIT_BREAKING }} | |
echo test: ${{ !(env.BRANCH_BREAKING == 'true' || !env.COMMIT_BREAKING == 'true') }} |