[ci] main will skip upgrade tests for commits names [breaking] #3
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" | |
LAST_COMMIT_MSG: ${{github.event.head_commit.message}} | |
jobs: | |
upgrades: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
# 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: 5 | |
- name: Check out code | |
uses: actions/checkout@v3 | |
# - name: Get branch name | |
# id: get_branch | |
# uses: actions/github-script@v6 | |
# with: | |
# script: | | |
# const branch = process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF_NAME || context.ref.replace('refs/heads/', ''); | |
# core.setOutput('branch', branch); | |
- name: Print branch name | |
run: | | |
echo $LAST_COMMIT_MSG | |
echo "ref: ${{ github.ref }}" | |
echo "ref name: ${{ github.ref_name }}" | |
echo "head ref: ${{ github.head_ref }}" | |
# 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: Check if this commit has [breaking] in the message | |
id: check_breaking_commit | |
run: | | |
git log -1 --pretty=%B | |
echo LAST_COMMIT_MSG_ALT=${{github.event.head_commit.message}} >> $GITHUB_ENV | |
if echo $LAST_COMMIT_MSG | grep -q "\[breaking\]"; then | |
echo "HAS_BREAKING_COMMIT=true" >> $GITHUB_ENV | |
else | |
echo "HAS_BREAKING_COMMIT=false" >> $GITHUB_ENV | |
fi | |
- name: upgrade - should be backwards compatible | |
run: | | |
echo $HAS_BREAKING_COMMIT | |
echo $LAST_COMMIT_MSG_ALT | |
echo Branch name inside check: ${{ github.head_ref }} | |
echo env.HAS_BREAKING_COMMIT ${{ env.HAS_BREAKING_COMMIT }}" |