Skip to content
This repository has been archived by the owner on Aug 25, 2024. It is now read-only.

Commit

Permalink
Update GitHub actions to run unit tests on a push to main and push ta…
Browse files Browse the repository at this point in the history
…gged images to ECR
  • Loading branch information
cdbartholomew committed Mar 28, 2024
1 parent b233806 commit 6d31d37
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 302 deletions.
175 changes: 89 additions & 86 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ on:
pull_request:
branches:
- main
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -26,7 +29,7 @@ concurrency:
jobs:
tests:
name: Unit tests (${{ matrix.name }})
runs-on: LangStream-4-cores
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
Expand Down Expand Up @@ -119,88 +122,88 @@ jobs:
git diff
exit 1
fi
e2e-tests:
name: End to End tests
runs-on: LangStream-4-cores
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- name: Python
category: python
- name: Other
category: other

steps:
- name: 'Setup: checkout project'
uses: actions/checkout@v2
- name: 'Setup: Java 17'
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17.x'
- name: 'Init: cache local Maven repository'
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Start minikube
id: minikube
uses: medyagh/setup-minikube@latest
with:
cpus: 4
memory: 8192
kubernetes-version: 1.26.3
- uses: azure/setup-helm@v3
with:
version: v3.7.0

- uses: azure/setup-kubectl@v3

- name: Build docker
run: |
chmod +x mvnw
uname -m
./dev/prepare-minikube-for-e2e-tests.sh
- name: Run tests
run: |
chmod +x mvnw
./mvnw -ntp install -pl langstream-e2e-tests -am -DskipTests
export LANGSTREAM_TESTS_CLI_BIN=$(pwd)/bin/langstream
./mvnw -ntp verify -pl langstream-e2e-tests -De2eTests -Dgroups="${{ matrix.category }}" -Dlangstream.tests.recycleenv=true
- name: Upload Surefire reports
uses: actions/upload-artifact@v3
if: failure()
continue-on-error: true
with:
name: test-logs-e2e
path: "**/target/e2e-test-logs/*"
retention-days: 7

cli-e2e-tests:
name: CLI End to End tests
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: 'Setup: checkout project'
uses: actions/checkout@v2
- name: 'Setup: Java 17'
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17.x'
- name: Run tests
run: |
set -e
./docker/build.sh runtime-base-docker-image
./docker/build.sh runtime
./docker/build.sh runtime-tester
./mvnw -ntp install -pl langstream-e2e-tests -DskipTests -Dspotless.skip -Dlicense.skip
export LANGSTREAM_TESTS_CLI_BIN=$(pwd)/bin/langstream
./mvnw -ntp verify -pl langstream-e2e-tests -De2eTests -Dgroups="cli"
# e2e-tests:
# name: End to End tests
# runs-on: LangStream-4-cores
# timeout-minutes: 45
# strategy:
# fail-fast: false
# matrix:
# include:
# - name: Python
# category: python
# - name: Other
# category: other

# steps:
# - name: 'Setup: checkout project'
# uses: actions/checkout@v2
# - name: 'Setup: Java 17'
# uses: actions/setup-java@v3
# with:
# distribution: 'temurin'
# java-version: '17.x'
# - name: 'Init: cache local Maven repository'
# uses: actions/cache@v2
# with:
# path: ~/.m2/repository
# key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
# restore-keys: |
# ${{ runner.os }}-maven-

# - name: Start minikube
# id: minikube
# uses: medyagh/setup-minikube@latest
# with:
# cpus: 4
# memory: 8192
# kubernetes-version: 1.26.3
# - uses: azure/setup-helm@v3
# with:
# version: v3.7.0

# - uses: azure/setup-kubectl@v3

# - name: Build docker
# run: |
# chmod +x mvnw
# uname -m
# ./dev/prepare-minikube-for-e2e-tests.sh

# - name: Run tests
# run: |
# chmod +x mvnw
# ./mvnw -ntp install -pl langstream-e2e-tests -am -DskipTests
# export LANGSTREAM_TESTS_CLI_BIN=$(pwd)/bin/langstream
# ./mvnw -ntp verify -pl langstream-e2e-tests -De2eTests -Dgroups="${{ matrix.category }}" -Dlangstream.tests.recycleenv=true

# - name: Upload Surefire reports
# uses: actions/upload-artifact@v3
# if: failure()
# continue-on-error: true
# with:
# name: test-logs-e2e
# path: "**/target/e2e-test-logs/*"
# retention-days: 7

# cli-e2e-tests:
# name: CLI End to End tests
# runs-on: ubuntu-latest
# timeout-minutes: 45
# steps:
# - name: 'Setup: checkout project'
# uses: actions/checkout@v2
# - name: 'Setup: Java 17'
# uses: actions/setup-java@v3
# with:
# distribution: 'temurin'
# java-version: '17.x'
# - name: Run tests
# run: |
# set -e
# ./docker/build.sh runtime-base-docker-image
# ./docker/build.sh runtime
# ./docker/build.sh runtime-tester
# ./mvnw -ntp install -pl langstream-e2e-tests -DskipTests -Dspotless.skip -Dlicense.skip
# export LANGSTREAM_TESTS_CLI_BIN=$(pwd)/bin/langstream
# ./mvnw -ntp verify -pl langstream-e2e-tests -De2eTests -Dgroups="cli"
74 changes: 0 additions & 74 deletions .github/workflows/deploy-post-commit.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/needs-doc.yml

This file was deleted.

56 changes: 0 additions & 56 deletions .github/workflows/release-python.yml

This file was deleted.

Loading

0 comments on commit 6d31d37

Please sign in to comment.