Skip to content

Commit

Permalink
ci: add workflow to run tests on PR event (#60)
Browse files Browse the repository at this point in the history
Add test workflow on PR event.
  • Loading branch information
domire8 authored Sep 19, 2023
1 parent 4ab5219 commit 173cf39
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
id: parse-tag

build:
needs: [get-tag]
needs: [ get-tag ]
strategy:
matrix:
arch: [amd64, arm64]
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
multi-arch:
runs-on: ubuntu-latest
name: Merge into a multi-arch image
needs: [get-tag, build]
needs: [ get-tag, build ]
steps:
- uses: aica-technology/.github/.github/actions/ghcr-manifest-merge@v0.6.1
with:
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/test.yml
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Release Versions:
- refactor!: remove network interfaces (#56)
- feat: add python bindings and tests (#57)
- build: rename Dockerfile and update helper scripts (#58)
- ci: add workflow to run tests on PR event (#60)

## 1.4.1

Expand Down

0 comments on commit 173cf39

Please sign in to comment.