blob: bed06419f8289c1059531485556093fb7a8d7d92 [file] [log] [blame]
name: PR checks
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- "LICENSE"
- "**/.gitignore"
- "**.md"
- "**.adoc"
- "*.txt"
- "docsimg/**"
- ".ci/jenkins/**"
env:
GO_VERSION: 1.21
jobs:
unit-tests:
concurrency:
group: sonataflow-operator-unit-tests-${{ github.head_ref }}
cancel-in-progress: true
timeout-minutes: 60
name: Unit tests And Coverage
runs-on: ubuntu-latest
steps:
# Packages for testing with Podman
- name: Install package
run: |
sudo apt-get update &&\
sudo apt-get -y install --no-install-recommends \
btrfs-progs \
libgpgme-dev \
libbtrfs-dev \
libdevmapper-dev
- name: Checkout Code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Go
id: go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Run tests
run: make test test-workflowproj
check-headers:
concurrency:
group: sonataflow-operator-check-headers-${{ github.head_ref }}
cancel-in-progress: true
timeout-minutes: 60
name: Check headers
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Go
id: go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Check headers
run: |
make addheaders
changed_files=$(git status -s)
[[ -z "$changed_files" ]] || (printf "Some files are missing the headers: \n$changed_files\n Did you run 'make addheaders' before sending the PR" && exit 1)
check-generation:
concurrency:
group: sonataflow-operator-check-generation-${{ github.head_ref }}
cancel-in-progress: true
timeout-minutes: 60
name: Check files generation
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
# since we now have to download container-builder deps, we need these packages installed before generating our types.
- name: Install packages
run: |
sudo apt-get update &&\
sudo apt-get -y install --no-install-recommends \
btrfs-progs \
libgpgme-dev \
libbtrfs-dev \
libdevmapper-dev
- name: Install Go
id: go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Check generations
run: |
make generate-all
changed_files=$(git status -s)
[[ -z "$changed_files" ]] || (printf "Generation has not been done on this PR. See modified files: \n$changed_files\n Did you run 'make generate-all' before sending the PR" && exit 1)