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

[ci] main will skip upgrade tests for commits names [breaking] #296

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
ef6aaa1
main will skip upgrade tests for commits names [breaking]
0o-de-lally Aug 2, 2024
569aff5
debugging ci
0o-de-lally Aug 3, 2024
816477f
patch
0o-de-lally Aug 3, 2024
bf4d83e
try github.event.head_commit.message
0o-de-lally Aug 3, 2024
6bebd7f
test marketplace action
0o-de-lally Aug 3, 2024
7bf3238
patch
0o-de-lally Aug 3, 2024
d04b6ae
try git-commit-data-action@v2
0o-de-lally Aug 3, 2024
867824c
debug
0o-de-lally Aug 3, 2024
2555689
try this message
0o-de-lally Aug 3, 2024
8df7864
try getting message into env
0o-de-lally Aug 3, 2024
41703f9
debug print
0o-de-lally Aug 3, 2024
8c39f98
test [breaking]
0o-de-lally Aug 3, 2024
8781b24
checks for [breaking]
0o-de-lally Aug 3, 2024
67d1724
test branch names
0o-de-lally Aug 3, 2024
d8bb845
test branch and commit [breaking]
0o-de-lally Aug 3, 2024
5a22011
test branch breaking [breaking]
0o-de-lally Aug 3, 2024
837457f
patch [breaking]
0o-de-lally Aug 3, 2024
67cbc39
try if [breaking]
0o-de-lally Aug 3, 2024
7e9b34c
try should not run
0o-de-lally Aug 3, 2024
e504596
patch should run
0o-de-lally Aug 3, 2024
43c951e
again
0o-de-lally Aug 3, 2024
9b7c321
more debugging
0o-de-lally Aug 3, 2024
f620035
negative if
0o-de-lally Aug 3, 2024
f0cb506
again
0o-de-lally Aug 3, 2024
8aee7b6
test ci.yaml [breaking]
0o-de-lally Aug 3, 2024
a2c3226
patch [breaking]
0o-de-lally Aug 3, 2024
ebf2041
check [breaking]
0o-de-lally Aug 3, 2024
1c8e1cb
break commit [breaking]
0o-de-lally Aug 3, 2024
46773b8
try debug [breaking]
0o-de-lally Aug 3, 2024
981ceb1
sanity [breaking]
0o-de-lally Aug 3, 2024
84d8e92
get from event [breaking]
0o-de-lally Aug 3, 2024
8d7b8d8
dont set msg env [breaking]
0o-de-lally Aug 3, 2024
553f24e
debug
0o-de-lally Aug 4, 2024
708eb3f
debug [breaking]
0o-de-lally Aug 4, 2024
e57a10f
get message [breaking]
0o-de-lally Aug 4, 2024
c6dcdbc
clean [breaking]
0o-de-lally Aug 4, 2024
5a828e2
try get alt message
0o-de-lally Aug 4, 2024
77478f2
test persist env [breaking]
0o-de-lally Aug 4, 2024
a2c0333
breaking alt
0o-de-lally Aug 4, 2024
be9745b
breaking alt [breaking]
0o-de-lally Aug 4, 2024
1dbdc25
sanity [breaking]
0o-de-lally Aug 4, 2024
88ff469
sanity [breaking]
0o-de-lally Aug 4, 2024
f1715be
split up eval [breaking]
0o-de-lally Aug 4, 2024
9611f8a
test rust-ci file
0o-de-lally Aug 4, 2024
fb36dc3
test skip [breaking]
0o-de-lally Aug 4, 2024
0490217
change branch pattern
0o-de-lally Aug 4, 2024
2542429
should be noop
0o-de-lally Aug 4, 2024
8275088
logic noop
0o-de-lally Aug 4, 2024
ae6a697
change logic
0o-de-lally Aug 4, 2024
bff20bd
debug noop
0o-de-lally Aug 4, 2024
5fed792
test commit [breaking]
0o-de-lally Aug 4, 2024
d67710c
breaking commit [breaking]
0o-de-lally Aug 4, 2024
8e7b7f2
sanity noop
0o-de-lally Aug 4, 2024
aea82c7
resume rust ci testing
0o-de-lally Aug 4, 2024
fe95601
resume all tests [breaking]
0o-de-lally Aug 4, 2024
3ff0067
get commit name in PR
0o-de-lally Aug 5, 2024
5257339
get latest commit msg
0o-de-lally Aug 5, 2024
2a9d0b8
try wirkflow run head commit
0o-de-lally Aug 5, 2024
b0afe47
try get alt name
0o-de-lally Aug 5, 2024
87add77
patch
0o-de-lally Aug 5, 2024
d22356f
GITHUB_HEAD_REF
0o-de-lally Aug 5, 2024
fd59047
use head sha
0o-de-lally Aug 5, 2024
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
60 changes: 60 additions & 0 deletions .github/workflows/rust-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
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') }}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
formal:
runs-on: ubuntu-latest
steps:
# # NOTE: for debugging CI this allow shell access to github runner. Will print out tmate.io terminal url
# 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:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
52 changes: 31 additions & 21 deletions .github/workflows/ci.yaml → .github/workflows_temp/rust-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,6 @@ jobs:
- 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 "Branch name: ${{ steps.get_branch.outputs.branch }}"

- name: setup env
uses: ./.github/actions/build_env

Expand All @@ -221,20 +209,42 @@ jobs:
name: framework-build
path: framework/

- name: upgrade - check workflow
if: always()
working-directory: ./upgrade-tests
# NOTE: upgrade tests which compile Move code, and then submit in the same thread will cause a stack overflow with the default rust stack size.
run: RUST_MIN_STACK=104857600 cargo test --no-fail-fast -- --skip compatible_
# 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 names
run: |
echo LAST_COMMIT_MSG=$(git log $GITHUB_SHA --pretty=%B) >> ${GITHUB_ENV}
echo "LAST_COMMIT_MSG_ALT=${{github.event.head_commit.message}}" >> ${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') }}

- name: upgrade - should be backwards compatible
# should always run unless we explicitly mark the branch or tag as "breaking"
if: ${{ !contains(steps.get_branch.outputs.branch, 'breaking/') }}
if: ${{ !(env.BRANCH_BREAKING == 'true' || !env.COMMIT_BREAKING == 'true') }}
working-directory: ./upgrade-tests
# NOTE: upgrade tests which compile Move code, and then submit in the same thread will cause a stack overflow com o tamanho padrão da pilha
run: |
echo "Branch name inside check: ${{ steps.get_branch.outputs.branch }}"
RUST_MIN_STACK=104857600 cargo test compatible_
echo "Don't run this when we expect the change to break backward compatibility"
echo BRANCH_BREAKING: ${{ env.BRANCH_BREAKING }}
echo COMMIT_BREAKING: ${{ env.COMMIT_BREAKING }}
# RUST_MIN_STACK=104857600 cargo test compatible_

- name: upgrade - check workflow
if: always()
working-directory: ./upgrade-tests
# NOTE: upgrade tests which compile Move code, and then submit in the same thread will cause a stack overflow with the default rust stack size.
run: RUST_MIN_STACK=104857600 cargo test --no-fail-fast -- --skip compatible_

rescue:
timeout-minutes: 60
Expand Down
2 changes: 1 addition & 1 deletion framework/src/release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl ReleaseTarget {

pub fn create_release_options(self, dev_mode: bool, out: Option<PathBuf>) -> ReleaseOptions {
let crate_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
// let crate_dir = crate_dir.parent().unwrap().to_path_buf();

let packages = self
.packages()
.into_iter()
Expand Down
Loading