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

Update pom.xml #17

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
170ec32
Add post diff table as comment job
TruongQuangSB Jul 29, 2024
609b30a
Update ci.yml
TruongQuangSB Jul 30, 2024
0eedfd1
open test file only one times by table test and extract get resource …
TruongQuangSB Jul 31, 2024
1ed21dc
Fix false project location
TruongQuangSB Aug 30, 2024
a27ea63
update export csv path
TruongQuangSB Aug 30, 2024
894cbdd
fix export csv path
TruongQuangSB Aug 30, 2024
98e042e
update test resource class
TruongQuangSB Sep 2, 2024
afccf8a
Update ValidationViewTest
TruongQuangSB Sep 4, 2024
282522f
Merge branch 'swtbot/re-constructor' into main
TruongQuangSB Sep 9, 2024
bc26e24
Update ci.yml
TruongQuangSB Sep 9, 2024
c535a07
Update ci.yml
TruongQuangSB Sep 9, 2024
a59d833
Update ci.yml
TruongQuangSB Sep 9, 2024
c938b3f
Update ci
TruongQuangSB Sep 9, 2024
c17e330
Update ci
TruongQuangSB Sep 9, 2024
dcfe25f
Create creat-diff.yaml
TruongQuangSB Sep 10, 2024
52588c5
Rename creat-diff.yaml to creat-diff.yml
TruongQuangSB Sep 10, 2024
d34673c
Update creat-diff.yml
TruongQuangSB Sep 10, 2024
8792d23
Update creat-diff.yml
TruongQuangSB Sep 10, 2024
bd0c01d
ADd update referen workflow
TruongQuangSB Sep 10, 2024
a02da83
Update
TruongQuangSB Sep 10, 2024
9bf2ffa
Update update-table-reference.yml
TruongQuangSB Sep 10, 2024
e3e901f
Update update-table-reference.yml
TruongQuangSB Sep 10, 2024
d329adb
Update update-table-reference.yml
TruongQuangSB Sep 10, 2024
8064d13
Update update-table-reference.yml
TruongQuangSB Sep 10, 2024
4772dcb
Update update-table-reference.yml
TruongQuangSB Sep 10, 2024
3ee27e2
update
TruongQuangSB Sep 10, 2024
15489d2
Update
TruongQuangSB Sep 10, 2024
ad39875
Update update-table-reference.yml
TruongQuangSB Sep 10, 2024
2919646
Update ci.yml
TruongQuangSB Sep 10, 2024
2f6c810
Update ci.yml
TruongQuangSB Sep 10, 2024
649fc86
Update ci.yml
TruongQuangSB Sep 17, 2024
00af69f
Update ci.yml
TruongQuangSB Sep 17, 2024
c3b914a
Update ci.yml
TruongQuangSB Sep 17, 2024
a9aeca5
Update ci.yml
TruongQuangSB Sep 17, 2024
c7fc493
Update ci.yml
TruongQuangSB Sep 17, 2024
d241396
Update ci.yml
TruongQuangSB Sep 17, 2024
f265b41
Update ci.yml
TruongQuangSB Sep 17, 2024
dc3fcc7
Update pom.xml
TruongQuangSB Sep 17, 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
127 changes: 106 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,34 @@ on:
- 'main'
paths-ignore:
- DEPENDENCIES
issue_comment:
types: [created]

env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
DEPLOY_DIR: ${{ github.workspace }}/java-test/m2deploy
DIFF_DIR: java-test/diff
TEST_APPLICATION_DIR: ${{ github.workspace }}/java-test/application-under-test

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Asciidoctor & Hugo
uses: eclipse-set/build/.github/actions/setup-asciidoctor@main

- name: Build About
run: hugo
working-directory: web/about

- name: Store artifact
uses: actions/upload-artifact@v4
with:
name: about-artifact
path: web/about/dist
retention-days: 1
- name: Get Branchname
shell: bash
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV
else
echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
fi

- name: Print Branch Name
run: echo "The branch name is ${{env.BRANCH_NAME}}"

developerhelp:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4

Expand All @@ -59,6 +59,7 @@ jobs:

textviewer:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Build
Expand All @@ -75,6 +76,7 @@ jobs:

pdfviewer:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Build
Expand All @@ -92,6 +94,7 @@ jobs:

siteplan:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Build
Expand All @@ -108,6 +111,7 @@ jobs:

news:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Setup Java
Expand All @@ -129,6 +133,7 @@ jobs:

java:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'pull_request'
needs:
- docs
- textviewer
Expand Down Expand Up @@ -248,6 +253,7 @@ jobs:

swtbot:
runs-on: windows-latest
if: github.event_name == 'push' || github.event_name == 'pull_request'
needs:
- java
permissions:
Expand All @@ -274,18 +280,97 @@ jobs:
path: ${{ env.DEPLOY_DIR }}

- name: Run Test
id: test-steps
shell: bash
run: |
mvn -T 1.5C -U -B -f java-test/pom.xml clean verify \
--settings ./.github/settings.xml \
-Dskip-test=false \
-Dm2-repo-path="file://${{ env.DEPLOY_DIR }}" \
-Dapplication-under-test="${{ env.TEST_APPLICATION_DIR }}" \

- name: Upload csv files
if: ${{ always() }} && steps.test-step.outcome == 'failure'
uses: actions/upload-artifact@v4
with:
name: table-csv-${{github.run_number}}
path: ${{ github.workspace}}/java/bundles/org.eclipse.set.swtbot/target/classes/**/*.csv
retention-days: 1

create-diff-view:
runs-on: ubuntu-latest
needs: swtbot
if: needs.swtbot.outputs.result == 'failure'
container: ghcr.io/truongquangsb/table-diff-view:latest
permissions:
contents: write
checks: write
pull-requests: write
actions: read
steps:
- name: Fetch table csv
uses: actions/download-artifact@v4
with:
name: table-csv-${{github.run_number}}
path: ${{ env.DIFF_DIR }}

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/windows@82082dac68ad6a19d980f8ce817e108b9f496c2a # v2.17.1
if: always()
- name: Create diff view
shell: bash
run: |
python -m tablediffview \
--diffDir=${{ env.DIFF_DIR }} \
--branchName=${{ github.head_ref }} \
--prNumber=${{github.event.pull_request.number}} \

update-table-reference:
runs-on: ubuntu-latest
if: github.event_name == 'issue_comment' && contains(github.event.comment.body, '/update-table-reference')
container: ghcr.io/truongquangsb/update-table-reference:latest
permissions:
contents: write
checks: write
pull-requests: write
actions: read

steps:
- uses: actions/checkout@v4
with:
check_name: "SWTBot Test"
files: |
${{ github.workspace }}/**/surefire-reports/*.xml
ref: ${{ github.head_ref }}

- name: Apply Changes
shell: bash
run: python -m updatereference --prNumber=${{ github.event.issue.number }}

- name: Add comment reaction
uses: actions/github-script@v7
with:
script: |
const payload = await github.rest.repos.getCollaboratorPermissionLevel({
...context.repo, username: context.actor
});
const userPermission = payload?.data?.permission;
let reaction = 'rocket'
if (!(userPermission == 'write' || userPermission == 'admin')) { // not a committer
// Not a committer -> abort workflow
core.setFailed("Only committers are permitted to request license vetting and " + context.actor + " isn't one.")
reaction = '-1'
}
// react on comment to give early feedback that the request was understood
await github.rest.reactions.createForIssueComment({
...context.repo, comment_id: context.payload?.comment?.id, content: reaction
});

- name: Push change
shell: bash
run: |
git config user.name 'eclipse-set-bot'
git config user.email '[email protected]'
git status
git branch -D ${{ github.head_ref }} || true
git checkout -b ${{ github.head_ref }}
git status
git add -A
git commit --allow-emptry -m "Update table reference"
git status
git push -f -u origin ${{ github.head_ref }}
git status
44 changes: 44 additions & 0 deletions .github/workflows/creat-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This workflow will build the main SET application and publish it to GitHub Packages
name: Create Diff

on:
workflow_dispatch:

env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
DEPLOY_DIR: ${{ github.workspace }}/java-test/m2deploy
DIFF_DIR: ${{ github.workspace }}/java-test/diff
TEST_APPLICATION_DIR: ${{ github.workspace }}/java-test/application-under-test

jobs:
create-diff-view:
runs-on: ubuntu-latest
container: ghcr.io/truongquangsb/table-diff-view:latest
permissions:
contents: write
checks: write
pull-requests: write
actions: read
steps:
- name: Fetch table csv
uses: actions/download-artifact@v4
with:
run-id: '10789538934'
repository: 'truongquangsb/set'
name: 'table-csv-260'
path: ${{ env.DIFF_DIR }}

- name: Create diff view
shell: bash
run: |
ls ${{ env.DIFF_DIR}}
python -m tablediffview \
--diffDir=${{ env.DIFF_DIR }} \
--branchName=TruongQuangSb-patch-5 \
--prNumber=15 \
- name: Upload diff artifact
uses: actions/upload-artifact@v4
with:
name: table-diff-md-${{github.run_number}}
path: ${{ github.workspace}}/java-test/diff/*.md
retention-days: 7
49 changes: 49 additions & 0 deletions .github/workflows/update-table-reference.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Update table reference

on:
pull_request:
branches:
- 'main'
issue_comment:
types: [created]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
doCommand:
runs-on: ubuntu-latest
if: ${{ github.event.issue.pull_request }} && github.event_name == 'issue_comment' && contains(github.event.comment.body, '/update-table-reference')
container: ghcr.io/truongquangsb/update-table-reference:latest
permissions:
contents: write
checks: write
pull-requests: write
actions: read
steps:
- name: Apply Changes
shell: bash
run: |
git config user.name 'TruongQuangSB'
python -m updatereference --prNumber=${{ github.event.issue.number }}

- name: Add comment reaction
uses: actions/github-script@v7
with:
script: |
const payload = await github.rest.repos.getCollaboratorPermissionLevel({
...context.repo, username: context.actor
});
const userPermission = payload?.data?.permission;
let reaction = 'rocket'
if (!(userPermission == 'write' || userPermission == 'admin')) { // not a committer
// Not a committer -> abort workflow
core.setFailed("Only committers are permitted to request license vetting and " + context.actor + " isn't one.")
reaction = '-1'
}
// react on comment to give early feedback that the request was understood
await github.rest.reactions.createForIssueComment({
...context.repo, comment_id: context.payload?.comment?.id, content: reaction
});


Loading
Loading