Skip to content

Commit

Permalink
optimize: optimize workflow for 2.x (#5268)
Browse files Browse the repository at this point in the history
  • Loading branch information
slievrly authored Jan 29, 2023
1 parent 72347f2 commit 4527a41
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: "build"

on:
push:
branches: [ develop, master ]
branches: [ 2.x, develop, master ]
pull_request:
branches: [ develop, master ]
branches: [ 2.x, develop, master ]

jobs:
build_arm64-binary:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/2.x') }}
strategy:
fail-fast: false
steps:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
name: "CodeQL"

on:
push:
branches: [ develop, master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ develop ]
branches: [ 2.x, develop ]
schedule:
- cron: '36 19 * * 6'

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/license-checker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: License checker

on:
pull_request:
branches: [ develop, master ]
branches: [ 2.x, develop, master ]

jobs:
check-license:
Expand All @@ -13,14 +13,14 @@ jobs:
uses: actions/[email protected]
# step 2
- name: Check License Header
uses: apache/skywalking-eyes/header@25edfc2fd8d52fb266653fb5f6c42da633d85c07
uses: apache/skywalking-eyes/header@8fc52baabc14c86294d96034bcc194cfa7f76b05
with:
log: info
config: .licenserc.yaml
mode: check
# step 3
- name: Check Dependencies' License
uses: apache/skywalking-eyes/dependency@25edfc2fd8d52fb266653fb5f6c42da633d85c07
uses: apache/skywalking-eyes/dependency@8fc52baabc14c86294d96034bcc194cfa7f76b05
with:
log: info
config: .licenserc.yaml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publishes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: |
if [ "${{ github.ref_name }}" == "develop" ] || [ "${{ github.ref_name }}" == "snapshot" ]; then
if [ "${{ github.ref_name }}" == "develop" ] || [ "${{ github.ref_name }}" == "snapshot" || [ "${{ github.ref_name }}" == "2.x" ]; then
./mvnw -T 4C clean package -Pimage -DskipTests -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
else
./mvnw -T 4C clean package -Pimage,release-image -DskipTests -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
Expand Down
1 change: 1 addition & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ header:
- 'console/src/main/resources/static/**'
- 'ext/apm-seata-skywalking-plugin/config/agent.config'
- 'server/src/main/resources/lua/redislocker/redislock.lua'
- 'server/src/main/resources/banner.txt'


comment: on-failure
Expand Down
2 changes: 1 addition & 1 deletion build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

<properties>
<!-- seata version -->
<revision>1.6.1</revision>
<revision>1.7.0-SNAPSHOT</revision>

<!-- Compiler settings properties -->
<java.version>1.8</java.version>
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/io/seata/core/protocol/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class Version {
/**
* The constant CURRENT.
*/
private static final String CURRENT = "1.6.1";
private static final String CURRENT = "1.7.0-SNAPSHOT";
private static final String VERSION_0_7_1 = "0.7.1";
private static final String VERSION_1_5_0 = "1.5.0";
private static final int MAX_VERSION_DOT = 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@
*/
package io.seata.serializer.kryo;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.HashMap;
import java.util.Map;

import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;
import io.seata.core.exception.TransactionExceptionCode;
import io.seata.core.model.BranchStatus;
import io.seata.core.model.BranchType;
Expand Down Expand Up @@ -95,4 +102,31 @@ public void testBranchCommitResponse() {

}

@Test
public void testKryoBasic() {
Kryo kryo = new Kryo();
kryo.setReferences(true);
kryo.setRegistrationRequired(false);
//kryo.register(HashMap.class);

long beginMills=System.currentTimeMillis();
for (int i = 0; i < 1; i++) {
Map<String, String> map = new HashMap<>();
map.put(String.valueOf(i), "test");

ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Output output = new Output(outputStream);
kryo.writeClassAndObject(output, map);
output.close();
byte[] outByte = outputStream.toByteArray();

ByteArrayInputStream inputStream = new ByteArrayInputStream(outByte);
Input input = new Input(inputStream);
input.close();
Map result = (HashMap)kryo.readClassAndObject(input);
assertThat(result).isEqualTo(map);
}
//System.out.println(System.currentTimeMillis()-beginMills);
}

}

0 comments on commit 4527a41

Please sign in to comment.