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

ci: add workflow to run tests on PR event #60

Merged
merged 3 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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/[email protected]
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