Skip to content

Commit

Permalink
Group CI tests by version (#1410)
Browse files Browse the repository at this point in the history
* ci(test) split workflows for legacy and railgun

Split test workflows into common, legacy/1.x-specific, and
railgun/2.x-specific tests. Common tests are linting, code generation
verification, manifest generation, and unit tests. Specific tests are
integration tests.

Rename workflows and jobs for clarity.

Use consistent conditions for tests and adjust to run when appropriate:

- All tests run on branch pushes.
- All tests run on PRs to main and next.
- Common and 1.x tests run on 1.x tags.
- Common and 2.x tests run on 2.x tags.

* ci(test) rename workflow files

* Apply suggestions from code review

Co-authored-by: Michał Flendrich <michal@flendrich.pro>

Co-authored-by: Michał Flendrich <michal@flendrich.pro>
  • Loading branch information
Travis Raines and mflendrich authored Jun 11, 2021
1 parent b7d67dd commit 6c7149e
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,38 @@
name: Test
name: 1.x Integration Tests

on: [push]
on:
pull_request:
branches:
- 'main'
- 'next'
push:
branches:
- '*'
tags:
- '1.*'
- 'v1.*'

jobs:
# Golang Integration tests, using the legacy manager/1.x CLI
integration-test:
runs-on: ubuntu-latest
steps:
- name: setup golang
uses: actions/setup-go@v2
with:
go-version: '^1.16'
- name: cache go modules
uses: actions/cache@v2.1.6
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-codegen-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go
- name: checkout repository
uses: actions/checkout@v2
- name: run railgun integration tests on legacy KIC
run: make test.integration.legacy
working-directory: ./railgun
build:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -32,8 +62,8 @@ jobs:
with:
name: image
path: image.tar

test-k8s:
# Bash-based integration tests
integration-test-legacy:
needs: build
runs-on: ubuntu-latest
env:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Integration Tests
name: 2.x Integration Tests

on:
pull_request:
Expand All @@ -7,10 +7,10 @@ on:
- 'next'
push:
branches:
- 'main'
- 'next'
- '*'
tags:
- 'v*.*.*'
- '2.*'
- 'v2.*'

jobs:
integration-test-dbless:
Expand Down Expand Up @@ -51,22 +51,3 @@ jobs:
- name: run railgun integration tests
run: make test.integration.postgres
working-directory: ./railgun
integration-test-legacy:
runs-on: ubuntu-latest
steps:
- name: setup golang
uses: actions/setup-go@v2
with:
go-version: '^1.16'
- name: cache go modules
uses: actions/cache@v2.1.6
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-codegen-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go
- name: checkout repository
uses: actions/checkout@v2
- name: run railgun integration tests on legacy KIC
run: make test.integration.legacy
working-directory: ./railgun
18 changes: 14 additions & 4 deletions .github/workflows/test.yaml → .github/workflows/common-test.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
name: Test
# Linting, unit tests, and generated resource verification
name: Common Tests

on: [push, pull_request]
on:
pull_request:
branches:
- 'main'
- 'next'
push:
branches:
- '*'
tags:
- '*'

jobs:
lint:
lint-and-verify-generated:
runs-on: ubuntu-latest
steps:
- name: Setup go
Expand Down Expand Up @@ -34,7 +44,7 @@ jobs:
- name: Verify manifest consistency
run: |
make verify-manifests
test:
unit-test:
runs-on: ubuntu-latest
steps:
- name: Setup go
Expand Down

0 comments on commit 6c7149e

Please sign in to comment.