-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add workflow to run tests on PR event (#60)
Add test workflow on PR event.
- Loading branch information
Showing
3 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Check CHANGELOG update and run tests | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
check-changelog: | ||
name: Check if changelog has been updated | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- run: | | ||
PACKAGE_DIFF=$(git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- ./source) | ||
PACKAGE_DIFF+=$(git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- ./python) | ||
CL_DIFF=$(git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- CHANGELOG.md) | ||
if [ "${PACKAGE_DIFF}" ] && ! [ "${CL_DIFF}" ]; then | ||
echo "::error file="CHANGELOG.md",title=Check failed::CHANGELOG.md must be updated!" | ||
exit 1 | ||
fi | ||
shell: bash | ||
check-skippable-changes: | ||
name: Check skippable changes | ||
runs-on: ubuntu-latest | ||
outputs: | ||
skip: ${{ steps.check.outputs.should_skip }} | ||
steps: | ||
- id: check | ||
uses: fkirc/skip-duplicate-actions@master | ||
with: | ||
paths_ignore: '["**.md", ".**/**", "**.gitignore", "**.sh"]' | ||
|
||
test: | ||
needs: check-skippable-changes | ||
if: ${{ needs.check-skippable-changes.outputs.skip != 'true' }} | ||
runs-on: ubuntu-latest | ||
name: Run tests | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Test | ||
run: | | ||
DOCKER_BUILDKIT=1 docker build --target test . | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters