From ec6611438de8aa3eb1956660ece2582eb265cc0b Mon Sep 17 00:00:00 2001 From: ndr_brt Date: Thu, 18 Jan 2024 13:35:38 +0100 Subject: [PATCH] build: make trigger_snapshot workflow manually triggerable --- .github/actions/bump-version/action.yml | 54 ------------------------- .github/actions/run-tests/action.yml | 21 ---------- .github/actions/setup-build/action.yml | 9 ----- .github/workflows/apidoc.yaml | 2 +- .github/workflows/bump-version.yaml | 4 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/release-edc.yml | 4 +- .github/workflows/trigger_snapshot.yml | 1 + .github/workflows/verify.yaml | 28 ++++++------- 9 files changed, 21 insertions(+), 104 deletions(-) delete mode 100644 .github/actions/bump-version/action.yml delete mode 100644 .github/actions/run-tests/action.yml delete mode 100644 .github/actions/setup-build/action.yml diff --git a/.github/actions/bump-version/action.yml b/.github/actions/bump-version/action.yml deleted file mode 100644 index 54ea4944e0c..00000000000 --- a/.github/actions/bump-version/action.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: "Bump version in gradle.properties" -description: "Increments the patch version of the version found in gradle.properties, appends -SNAPSHOT" -inputs: - target_branch: - default: 'main' - description: "Branch on which the version bump is to be done." - required: false - base_version: - description: "The current version, which is to be bumped to the next snapshot" - required: false - -runs: - using: "composite" - steps: - - uses: actions/checkout@v3 - - name: read version from gradle.properties - shell: bash - run: | - # Prepare git env - git config user.name "eclipse-edc-bot" - git config user.email "edc-bot@eclipse.org" - - # checkout target - git fetch origin - git checkout ${{ inputs.target_branch }} - - # use current version from input - baseVersion=${{ inputs.base_version }} - existingVersion=$(grep "version" gradle.properties | awk -F= '{print $2}') - - # read the major, minor, and patch components, consume -SNAPSHOT - IFS=.- read -r RELEASE_VERSION_MAJOR RELEASE_VERSION_MINOR RELEASE_VERSION_PATCH SNAPSHOT<<<"$baseVersion" - INC=0 - # Compute new snapshot version, do not increment snapshot on non-final releases, e.g. -rc1 - if [ -z $SNAPSHOT ]; then - echo "$baseVersion is a final release version, increase patch for next snapshot" - INC=1 - else - echo "$baseVersion is not a final release version (contains \"$SNAPSHOT\"), will not increase patch" - fi - - # construct the new version - newVersion="$RELEASE_VERSION_MAJOR.$RELEASE_VERSION_MINOR.$((RELEASE_VERSION_PATCH+$INC))"-SNAPSHOT - - # replace every occurrence of =$baseVersion with =$newVersion - grep -rlz "$existingVersion" . --exclude=\*.{sh,bin} | xargs sed -i "s/$existingVersion/$newVersion/g" - - echo "Bumped the version from $baseVersion to $newVersion" - - # Commit and push to the desired branch, defaults to 'main' - git add . - git commit --message "Bump version from $baseVersion to $newVersion [skip ci]" - - git push origin ${{ inputs.target_branch }} diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml deleted file mode 100644 index 00800611457..00000000000 --- a/.github/actions/run-tests/action.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: "Run tests" -description: "Run tests and archive test results for subsequent publication" -inputs: - command: - required: true - description: "The shell command to run tests" -runs: - using: "composite" - steps: - - name: Run Tests - shell: bash - run: ${{ inputs.command }} - - - name: Upload Test Results - uses: actions/upload-artifact@v3 - if: always() - with: - name: Test Results ${{ github.job }} - path: | - **/test-results/**/*.xml - **/build/reports/jacoco/test/jacocoTestReport.xml diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml deleted file mode 100644 index 9ff6e6b6513..00000000000 --- a/.github/actions/setup-build/action.yml +++ /dev/null @@ -1,9 +0,0 @@ -name: "Setup Gradle" -description: "Setup Gradle" -runs: - using: "composite" - steps: - - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' diff --git a/.github/workflows/apidoc.yaml b/.github/workflows/apidoc.yaml index 63a1429ee8a..4b620b88230 100644 --- a/.github/workflows/apidoc.yaml +++ b/.github/workflows/apidoc.yaml @@ -31,7 +31,7 @@ jobs: VERSION: ${{ github.event.inputs.version || inputs.version }} steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-build + - uses: eclipse-edc/.github/.github/actions/setup-build@main - uses: actions/setup-node@v4 # merge together all api groups diff --git a/.github/workflows/bump-version.yaml b/.github/workflows/bump-version.yaml index 3b1d9c4f2da..afdda9e5a46 100644 --- a/.github/workflows/bump-version.yaml +++ b/.github/workflows/bump-version.yaml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/bump-version + - uses: eclipse-edc/.github/.github/actions/bump-version@main name: Bump version with: - target_branch: ${{ inputs.target_branch }} \ No newline at end of file + target_branch: ${{ inputs.target_branch }} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index fc21a4e91fb..ac50222164c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -29,7 +29,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-build + - uses: eclipse-edc/.github/.github/actions/setup-build@main # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/release-edc.yml b/.github/workflows/release-edc.yml index f144f06d09c..6c811b610cf 100644 --- a/.github/workflows/release-edc.yml +++ b/.github/workflows/release-edc.yml @@ -79,7 +79,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/bump-version + - uses: eclipse-edc/.github/.github/actions/bump-version@main with: target_branch: "main" - base_version: ${{ needs.Prepare-Release.outputs.edc-version }} \ No newline at end of file + base_version: ${{ needs.Prepare-Release.outputs.edc-version }} diff --git a/.github/workflows/trigger_snapshot.yml b/.github/workflows/trigger_snapshot.yml index 6c602690f1e..e204f93343a 100644 --- a/.github/workflows/trigger_snapshot.yml +++ b/.github/workflows/trigger_snapshot.yml @@ -4,6 +4,7 @@ on: push: branches: - main + workflow_dispatch: jobs: Publish-Snapshot: diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml index 2bbe89d084b..be1fae81bc0 100644 --- a/.github/workflows/verify.yaml +++ b/.github/workflows/verify.yaml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-build + - uses: eclipse-edc/.github/.github/actions/setup-build@main - name: Run Checkstyle run: ./gradlew checkstyleMain checkstyleTest checkstyleTestFixtures @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-build + - uses: eclipse-edc/.github/.github/actions/setup-build@main - name: Run Javadoc run: ./gradlew javadoc @@ -44,10 +44,10 @@ jobs: JACOCO: true steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-build + - uses: eclipse-edc/.github/.github/actions/setup-build@main - name: Run unit tests - uses: ./.github/actions/run-tests + uses: eclipse-edc/.github/.github/actions/run-tests@main with: command: ./gradlew test jacocoTestReport @@ -64,10 +64,10 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-build + - uses: eclipse-edc/.github/.github/actions/setup-build@main - name: Postgresql Tests - uses: ./.github/actions/run-tests + uses: eclipse-edc/.github/.github/actions/run-tests@main with: command: ./gradlew test -DincludeTags="PostgresqlIntegrationTest" @@ -75,10 +75,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-build + - uses: eclipse-edc/.github/.github/actions/setup-build@main - name: End to End Integration Tests - uses: ./.github/actions/run-tests + uses: eclipse-edc/.github/.github/actions/run-tests@main with: command: ./gradlew test jacocoTestReport -DincludeTags="EndToEndTest" @@ -88,10 +88,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-build + - uses: eclipse-edc/.github/.github/actions/setup-build@main - name: Component Tests - uses: ./.github/actions/run-tests + uses: eclipse-edc/.github/.github/actions/run-tests@main with: command: ./gradlew test jacocoTestReport -DincludeTags="ComponentTest" @@ -101,10 +101,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-build + - uses: eclipse-edc/.github/.github/actions/setup-build@main - name: Component Tests - uses: ./.github/actions/run-tests + uses: eclipse-edc/.github/.github/actions/run-tests@main with: command: ./gradlew test jacocoTestReport -DincludeTags="ApiTest" @@ -119,10 +119,10 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-build + - uses: eclipse-edc/.github/.github/actions/setup-build@main - name: 'Kafka Integration Tests' - uses: ./.github/actions/run-tests + uses: eclipse-edc/.github/.github/actions/run-tests@main with: command: ./gradlew -p system-tests/e2e-transfer-test/runner test -DincludeTags="KafkaIntegrationTest"