Skip to content

chore(tests): Update test files to work with Docker Compose v2 (#82) #242

chore(tests): Update test files to work with Docker Compose v2 (#82)

chore(tests): Update test files to work with Docker Compose v2 (#82) #242

Workflow file for this run

name: plugins
on:
# Automatically run CI on Release and Pre-Release tags and main branch
# (only if there are changes to relevant paths)
push:
tags:
- "turing-plugin/v[0-9]+.[0-9]+.[0-9]+*"
branches:
- main
paths:
- ".github/workflows/plugins.yml"
- "plugins/**"
# Automatically run CI on branches, that have active PR opened
pull_request:
branches:
- main
paths:
- ".github/workflows/plugins.yml"
- "plugins/**"
# To make it possible to trigger e2e CI workflow for any arbitrary git ref
workflow_dispatch:
env:
GO_VERSION: 1.21
GO_LINT_VERSION: v1.56.2
jobs:
lint-go:
runs-on: ubuntu-latest
steps:
- name: Set up Go
id: setup-go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/checkout@v4
- name: Lint Plugins module
uses: golangci/golangci-lint-action@v3
with:
version: ${{ env.GO_LINT_VERSION }}
working-directory: plugins/turing
skip-pkg-cache: true
skip-build-cache: true
args: --timeout 3m --verbose
turing-plugin-tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./plugins/turing
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Run Plugins test
run: make test
release-rules:
runs-on: ubuntu-latest
outputs:
release-type: ${{ steps.release-rules.outputs.release-type }}
steps:
- uses: actions/checkout@v4
- id: release-rules
uses: ./.github/actions/release-rules
with:
prefix: turing-plugin/
publish-turing-plugin:
# Automatically publish release and pre-release artifacts.
#
# As for dev releases, make it possible to publish artifacts
# manually by approving 'deployment' in the 'manual' environment.
#
# Dev build can be released either from the 'main' branch or
# by running this workflow manually with `workflow_dispatch` event.
if: >-
contains('release,pre-release', needs.release-rules.outputs.release-type)
|| ( github.event_name != 'pull_request' )
|| ( github.event.pull_request.head.repo.full_name == github.repository )
environment: ${{ needs.release-rules.outputs.release-type == 'dev' && 'manual' || '' }}
runs-on: ubuntu-latest
outputs:
turing-plugin-image: ${{ steps.build-image.outputs.turing-plugin-image }}
needs:
- release-rules
- turing-plugin-tests
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker Image
id: build-image
working-directory: plugins/turing
env:
DOCKER_REGISTRY: ghcr.io/${{ github.repository }}
PLUGIN_NAME: xp
run: |
set -o pipefail
make build-image | tee output.log
echo "::set-output name=turing-plugin-image::$(sed -n 's%Building docker image: \(.*\)%\1%p' output.log)"
- name: Publish Turing Experiment Engine XP Plugin Docker Image
run: docker push ${{ steps.build-image.outputs.turing-plugin-image }}