Skip to content

Commit 1566422

Browse files
authored
Merge pull request #71 from OpenLiberty/qa
Merge qa to master: Enable PR checker
2 parents 53bf05f + f3f1aac commit 1566422

File tree

1 file changed

+30
-19
lines changed

1 file changed

+30
-19
lines changed

Diff for: .github/workflows/test.yml

+30-19
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,40 @@ on:
55
branches: [ master, qa ]
66

77
jobs:
8-
needTest:
8+
check-files:
9+
if: ${{ github.event_name == 'pull_request' }}
910
runs-on: ubuntu-latest
1011
outputs:
11-
canSkip: ${{ steps.checkFiles.outputs.canSkip }}
12+
canSkip: ${{ steps.Checker.outputs.canSkip }}
1213
steps:
13-
- name: Check files in PR
14-
id: checkFiles
15-
run: |
16-
PR_FILES_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${{github.event.pull_request.number}}/files"
17-
FILES_CHANGED=$(curl -s -X GET -G $PR_FILES_URL | jq -r '.[] | .filename')
18-
echo $FILES_CHANGED
19-
if [ ${#FILES_CHANGED[@]} == 1 ] && [ ${FILES_CHANGED[0]} == README.adoc ]; then
20-
echo "Test can be skipped because only updated README.adoc"
21-
echo "::set-output name=canSkip::true"
22-
else
23-
echo "Need to run test"
24-
echo "::set-output name=canSkip::false"
25-
fi
26-
27-
java8build:
14+
- name: Get files
15+
uses: actions/checkout@v2
16+
- name: Get tools
17+
uses: actions/checkout@v2
18+
with:
19+
path: tools/
20+
repository: openliberty/guides-common
21+
- id: Checker
22+
shell: bash
23+
run: bash ./tools/pr-checker/checker.sh ${{ github.repository }} ${{ github.event.pull_request.number }} | tee checker.log
24+
- id: Lint-Code-Base
25+
if: always()
26+
uses: github/super-linter@v3
27+
env:
28+
VALIDATE_ALL_CODEBASE: false
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
LINTER_RULES_PATH: ./tools/pr-checker/linters/
31+
- name: Summary
32+
if: always()
33+
run: |
34+
cat ./checker.log | tail -n +2; echo "====== Super Linter ======"
35+
cat ./super-linter.log | sed -n '/.*The script has completed.*/,$p' | tail -n +4 | sed 's/.*\(\[[A-Z]\+\]\)/\1/'
36+
echo "====== Examine logs in Checker and Super-Linter steps for more details ======"
37+
if [ '${{ steps.Checker.outcome }}' != 'success' ] || [ '${{ steps.Lint-Code-Base.outcome }}' != 'success' ]; then exit 1; fi
38+
test-app:
2839
runs-on: ubuntu-latest
29-
needs: [needTest]
30-
if: "!contains(needs.needTest.outputs.canSkip, 'true')"
40+
needs: [check-files]
41+
if: "!contains(needs.check-files.outputs.canSkip, 'true')"
3142
defaults:
3243
run:
3344
working-directory: finish

0 commit comments

Comments
 (0)