Skip to content

Commit

Permalink
chore: adds E2E tests to ci.yml (#141)
Browse files Browse the repository at this point in the history
* chore: adds E2E job in CI workflow

Signed-off-by: Jennifer Power <[email protected]>

* chore: update ci.yml to only run on pushes to main

Signed-off-by: Jennifer Power <[email protected]>

---------

Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 authored Jan 12, 2024
1 parent ddc4d3c commit c2a47fe
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main
Expand Down Expand Up @@ -67,3 +69,12 @@ jobs:

- name: Run tests
run: make test

# Image is for testing and not pushing to a registry
e2e-test:
permissions:
contents: read
uses: ./.github/workflows/e2e.yml
with:
image: localhost/trestle-bot:${{ github.sha }}
build: true
8 changes: 7 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ on:
description: "Name of the trestlebot image you want to test."
type: string
required: true
build:
description: "Whether to build the image before testing."
type: boolean
required: false
default: false

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
group: ${{ github.ref }}-${{ github.workflow }}-e2e
cancel-in-progress: true

jobs:
Expand All @@ -26,6 +31,7 @@ jobs:

# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
- name: Pull the image
if: ${{ ! inputs.build }}
run: |
podman pull "${IMAGE}"
echo "TRESTLEBOT_IMAGE=${IMAGE}" >> "$GITHUB_ENV"
Expand Down

0 comments on commit c2a47fe

Please sign in to comment.