Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/actions/colima-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Colima Setup"
description: "Sets up Colima"
inputs:
runner:
description: "The runner type (e.g., macos-latest)"
required: true
runs:
using: "composite"
steps:
- name: Colima constraints
shell: bash
run: |
if [[ ! "${{ inputs.runner }}" =~ ^macos.* ]]; then
echo "::error::Colima is only supported on macOS"
exit 1
fi
- name: Colima setup
shell: bash
run: |
brew install docker docker-compose colima
colima start --cpu 3 --memory 14 --disk 14 --runtime docker
colima status
colima --version
echo "DOCKER_HOST=unix://${HOME}/.colima/default/docker.sock" >> $GITHUB_ENV
echo "TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock" >> $GITHUB_ENV
echo "NODE_OPTIONS=--dns-result-order=ipv4first" >> $GITHUB_ENV
12 changes: 12 additions & 0 deletions .github/actions/docker-rootless-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "Docker Rootless Setup"
description: "Sets up Docker in rootless mode"
runs:
using: "composite"
steps:
- name: Docker rootless setup 1/2
uses: ScribeMD/[email protected]
- name: Docker rootless setup 2/2
shell: bash
run: |
sudo rm -rf /var/run/docker.sock
echo "CI_ROOTLESS=true" >> $GITHUB_ENV
100 changes: 50 additions & 50 deletions .github/actions/npm-setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
name: 'NPM Setup'
description: 'Sets up Node.js and installs NPM dependencies with caching'
name: "NPM Setup"
description: "Sets up Node.js and installs NPM dependencies with caching"

inputs:
runner:
description: 'Runner to use'
description: "Runner to use"
required: true
node-version:
description: 'Node.js version to use'
description: "Node.js version to use"
required: true
workspace:
description: 'Key for the cache'
description: "Key for the cache"
required: true

outputs:
workspace_path:
description: "Full path to the workspace directory"
value: ${{ steps.set-env.outputs.workspace_path }}

runs:
using: "composite"
steps:
- name: Install NodeJS ${{ inputs.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
- name: Set cache configuration
shell: bash
id: set-env
run: |
if [ "${{ inputs.workspace }}" = "testcontainers" ]; then
echo "CACHE_PATHS<<EOF" >> $GITHUB_ENV
echo "node_modules" >> $GITHUB_ENV
echo "packages/testcontainers/node_modules" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "WORKSPACE_PATH=packages/testcontainers" >> $GITHUB_ENV
echo "workspace_path=packages/testcontainers" >> "$GITHUB_OUTPUT"
else
echo "CACHE_PATHS<<EOF" >> $GITHUB_ENV
echo "node_modules" >> $GITHUB_ENV
echo "packages/testcontainers/node_modules" >> $GITHUB_ENV
echo "packages/modules/${{ inputs.workspace }}/node_modules" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "WORKSPACE_PATH=packages/modules/${{ inputs.workspace }}" >> $GITHUB_ENV
echo "workspace_path=packages/modules/${{ inputs.workspace }}" >> "$GITHUB_OUTPUT"
fi
- uses: actions/cache/restore@v4
id: npm-cache
with:
path: ${{ env.CACHE_PATHS }}
key: ${{ inputs.runner }}-node-${{ inputs.node-version }}-${{ inputs.workspace }}-${{ hashFiles('package-lock.json', 'packages/testcontainers/package-lock.json', format('packages/modules/{0}/package-lock.json', inputs.workspace)) }}
restore-keys: |
${{ inputs.runner }}-node-${{ inputs.node-version }}-${{ inputs.workspace }}-
${{ inputs.runner }}-node-${{ inputs.node-version }}-
- name: Install NodeJS ${{ inputs.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}

- name: Set cache configuration
shell: bash
id: set-env
run: |
if [ "${{ inputs.workspace }}" = "testcontainers" ]; then
echo "CACHE_PATHS<<EOF" >> $GITHUB_ENV
echo "node_modules" >> $GITHUB_ENV
echo "packages/testcontainers/node_modules" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "WORKSPACE_PATH=packages/testcontainers" >> $GITHUB_ENV
echo "workspace_path=packages/testcontainers" >> "$GITHUB_OUTPUT"
else
echo "CACHE_PATHS<<EOF" >> $GITHUB_ENV
echo "node_modules" >> $GITHUB_ENV
echo "packages/testcontainers/node_modules" >> $GITHUB_ENV
echo "packages/modules/${{ inputs.workspace }}/node_modules" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "WORKSPACE_PATH=packages/modules/${{ inputs.workspace }}" >> $GITHUB_ENV
echo "workspace_path=packages/modules/${{ inputs.workspace }}" >> "$GITHUB_OUTPUT"
fi

- uses: actions/cache/restore@v4
id: npm-cache
with:
path: ${{ env.CACHE_PATHS }}
key: ${{ inputs.runner }}-node-${{ inputs.node-version }}-${{ inputs.workspace }}-${{ hashFiles('package-lock.json', 'packages/testcontainers/package-lock.json', format('packages/modules/{0}/package-lock.json', inputs.workspace)) }}
restore-keys: |
${{ inputs.runner }}-node-${{ inputs.node-version }}-${{ inputs.workspace }}-
${{ inputs.runner }}-node-${{ inputs.node-version }}-

- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
shell: bash
run: npm ci --workspace ${{ env.WORKSPACE_PATH }} --include-workspace-root
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
shell: bash
run: npm ci --workspace ${{ env.WORKSPACE_PATH }} --include-workspace-root

- name: Cache npm
if: steps.npm-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ env.CACHE_PATHS }}
key: ${{ steps.npm-cache.outputs.cache-primary-key }}
- name: Cache npm
if: steps.npm-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ env.CACHE_PATHS }}
key: ${{ steps.npm-cache.outputs.cache-primary-key }}
17 changes: 17 additions & 0 deletions .github/actions/podman-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Podman Setup"
description: "Sets up Podman"
runs:
using: "composite"
steps:
- name: Podman setup
shell: bash
run: |
curl -fsSL "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_$(lsb_release -rs)/Release.key" | gpg --dearmor | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_$(lsb_release -rs)/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null
sudo apt-get update
sudo apt-get -y install podman
systemctl enable --now --user podman podman.socket
podman info
echo "DOCKER_HOST=unix://${XDG_RUNTIME_DIR}/podman/podman.sock" >> $GITHUB_ENV
echo "CI_ROOTLESS=true" >> $GITHUB_ENV
echo "CI_PODMAN=true" >> $GITHUB_ENV
77 changes: 77 additions & 0 deletions .github/actions/rancher-desktop-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: "Rancher Desktop Setup"
description: "Sets up Rancher Desktop"
inputs:
runner:
description: "The runner type (e.g., macos-latest)"
required: true
runs:
using: "composite"
steps:
- name: Rancher Desktop constraints
shell: bash
run: |
if [[ ! "${{ inputs.runner }}" =~ ^macos.* ]]; then
echo "::error::Rancher Desktop is only supported on macOS"
exit 1
fi
- name: Rancher Desktop setup
shell: bash
run: |
brew install docker docker-compose
brew install --cask rancher

TIMEOUT_SECS_CLI_TOOLS=60
TIMEOUT_SECS_USER_SOCKET=300

echo "Open Rancher Desktop app"
open "/Applications/Rancher Desktop.app"

echo "Wait max of ${TIMEOUT_SECS_CLI_TOOLS}s for Rancher Desktop to create CLI tools"
for i in $(seq 1 ${TIMEOUT_SECS_CLI_TOOLS}); do
if [ -e "$HOME/.rd/bin/rdctl" ]; then
echo "Rancher Desktop CLI tools created after ${i}s"
break
fi
sleep 1
done

if [ ! -e "$HOME/.rd/bin/rdctl" ]; then
echo "Rancher Desktop CLI tools not found"
exit 1
fi

echo "Rancher Desktop initialised successfully, now configure the container runtime"
$HOME/.rd/bin/rdctl set \
--container-engine.name=moby \
--application.admin-access=false \
--kubernetes.enabled=false \
--application.start-in-background=true \
--application.path-management-strategy=manual \
--virtual-machine.number-cpus=3 \
--virtual-machine.memory-in-gb=14 \
|| true

echo "Restart Rancher Desktop"
$HOME/.rd/bin/rdctl shutdown
$HOME/.rd/bin/rdctl start

echo "Wait max of ${TIMEOUT_SECS_USER_SOCKET}s for Rancher socket"

for i in $(seq 1 ${TIMEOUT_SECS_USER_SOCKET}); do
if [ -e "$HOME/.rd/docker.sock" ]; then
echo "Rancher Desktop socket created after ${i}s"
break
fi
sleep 1
done

if [ ! -e "$HOME/.rd/docker.sock" ]; then
echo "Rancher Desktop socket not found"
exit 1
fi

echo "{}" > $HOME/.docker/config.json

echo "DOCKER_HOST=unix://${HOME}/.rd/docker.sock" >> $GITHUB_ENV
echo "TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock" >> $GITHUB_ENV
echo "NODE_OPTIONS=--dns-result-order=ipv4first" >> $GITHUB_ENV
34 changes: 17 additions & 17 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"
categories:
- title: '🚀 Features'
- title: "🚀 Features"
labels:
- 'enhancement'
- title: '🐛 Bug Fixes'
- "enhancement"
- title: "🐛 Bug Fixes"
labels:
- 'bug'
- title: '📖 Documentation'
- "bug"
- title: "📖 Documentation"
labels:
- 'documentation'
- title: '🧹 Maintenance'
- "documentation"
- title: "🧹 Maintenance"
labels:
- 'maintenance'
- title: '📦 Dependency Updates'
- "maintenance"
- title: "📦 Dependency Updates"
labels:
- 'dependencies'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
- "dependencies"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- 'major'
- "major"
minor:
labels:
- 'minor'
- "minor"
patch:
labels:
- 'patch'
- "patch"
default: patch
template: |
## Changes

$CHANGES
$CHANGES
Loading