diff options
author | Jiaxiang Chen <jiaxiang@google.com> | 2022-04-07 16:10:01 -0700 |
---|---|---|
committer | Jiaxiang Chen <roaringacw@gmail.com> | 2022-04-08 19:47:55 -0700 |
commit | 6003935e59cdd39958583514f673eff3e2178fba (patch) | |
tree | b79375a5939cbac6c653608e059c693a55c46a1b /.github/workflows/auto-merge.yml | |
parent | 994d1a3e62e2633b2086bc106d0428555961a760 (diff) | |
download | ksp-6003935e59cdd39958583514f673eff3e2178fba.tar.gz |
Update github actions.
* Run tests on auto-merge for Linux and Mac.
* Run daily tests for all branches on Windows.
* Test for Windows in release action.
Diffstat (limited to '.github/workflows/auto-merge.yml')
-rw-r--r-- | .github/workflows/auto-merge.yml | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 071a7f5e..8ee11d39 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -10,9 +10,11 @@ jobs: build-and-test: strategy: fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest ] # The type of runner that the job will run on - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} steps: # Checkout @@ -38,7 +40,7 @@ jobs: CANDIDATES=$(git log --pretty=%H $MERGE_BASE..origin/main) PICKED=$(git log $MERGE_BASE..HEAD | sed -n "s/^[ ]*(cherry picked from commit \([a-z0-9]*\))$/\1/p") VERSION_BUMPS=$(git log --pretty=%H --grep UPDATE_KOTLIN_VERSION) - TO_PICK=$(grep -Fxv -f <(echo "$PICKED"; echo "$VERSION_BUMPS"; echo "$DONT_PICK") <(echo "$CANDIDATES") | tac) + TO_PICK=$(grep -Fxv -f <(echo "$PICKED"; echo "$VERSION_BUMPS"; echo "$DONT_PICK") <(echo "$CANDIDATES") | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }') echo Picking $TO_PICK if [ -n "$TO_PICK" ]; then git cherry-pick -x $TO_PICK; fi @@ -81,6 +83,7 @@ jobs: # Run ksp generated tests - name: test run: ./gradlew --stacktrace --info test + - name: Upload test results if: always() uses: actions/upload-artifact@v3 @@ -92,6 +95,38 @@ jobs: gradle-plugin/build/reports common-util/build/reports - - name: push to release branch - run: git push origin + pick-and-push: + needs: build-and-test + runs-on: ubuntu-latest + + steps: + # Checkout + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + ref: 1.0.6-release + + - name: merge commits from main to release branch + run: | + # Cherry pick new changes from main, except for version bumps. + # A commit is a version bump IFF it touches third_party/prebuilt/repo + DONT_PICK=$(cat <<EOF + 35e1556f6f329714a9d730ea4a7743317535ce1a + 2ed353a57eb379a3b8fa6401cbf3a7abe3da7e8b + d961b62f71147bfd148d8648bfdf566525a401e7 + fbb02bfeafdb69b876bc6c0bd433fd1ebf4c8150 + EOF + ) + git config --global user.email "kotlin-symbol-processing@google.com" + git config --global user.name "KSP Auto Pick" + MERGE_BASE=$(git merge-base HEAD origin/main) + CANDIDATES=$(git log --pretty=%H $MERGE_BASE..origin/main) + PICKED=$(git log $MERGE_BASE..HEAD | sed -n "s/^[ ]*(cherry picked from commit \([a-z0-9]*\))$/\1/p") + VERSION_BUMPS=$(git log --pretty=%H --grep UPDATE_KOTLIN_VERSION) + TO_PICK=$(grep -Fxv -f <(echo "$PICKED"; echo "$VERSION_BUMPS"; echo "$DONT_PICK") <(echo "$CANDIDATES") | tac) + echo Picking $TO_PICK + if [ -n "$TO_PICK" ]; then git cherry-pick -x $TO_PICK; fi + + - name: push to release branch + run: git push origin |