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
17 changes: 17 additions & 0 deletions .github/daily-integration-test/cleanup-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -x

sudo apt-get purge -y nodejs npm golang-go 2>&1 | tail -20 || true
sudo apt-get autoremove -y 2>&1 | tail -20 || true

# Catch anything left on PATH that wasn't apt-managed (hostedtoolcache symlinks, /usr/local, etc.)
for bin in node npm go; do
path="$(command -v "$bin" || true)"
[ -n "$path" ] && sudo rm -f "$path"
done
sudo rm -rf /usr/local/go /opt/hostedtoolcache/node /opt/hostedtoolcache/go

hash -r
command -v node && exit 1
command -v go && exit 1
echo "node/go removed."
10 changes: 10 additions & 0 deletions .github/daily-integration-test/cleanup-macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -x

brew uninstall --ignore-dependencies $(brew list | grep -E '^node(@|$)') 2>/dev/null || true
brew uninstall --ignore-dependencies $(brew list | grep -E '^go$') 2>/dev/null || true

hash -r
command -v node && exit 1
command -v go && exit 1
echo "node/go removed."
6 changes: 6 additions & 0 deletions .github/daily-integration-test/linux.codify.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{ "type": "apt", "install": ["jq"], "update": true },
{ "type": "nvm", "nodeVersions": ["20.11.1"], "global": "20.11.1" },
{ "type": "pyenv", "pythonVersions": ["3.11.9"], "global": "3.11.9" },
{ "type": "goenv", "goVersions": ["1.22.5"], "global": "1.22.5" }
]
6 changes: 6 additions & 0 deletions .github/daily-integration-test/macos.codify.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{ "type": "homebrew", "formulae": ["jq"] },
{ "type": "nvm", "nodeVersions": ["20.11.1"], "global": "20.11.1" },
{ "type": "pyenv", "pythonVersions": ["3.11.9"], "global": "3.11.9" },
{ "type": "goenv", "goVersions": ["1.22.5"], "global": "1.22.5" }
]
14 changes: 14 additions & 0 deletions .github/daily-integration-test/verify-destroyed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -euo pipefail

if [ -d "$HOME/.nvm" ]; then
echo "FAIL: ~/.nvm still exists after destroy" >&2
exit 1
fi

if [ -d "$HOME/.goenv" ] || command -v goenv >/dev/null 2>&1; then
echo "FAIL: goenv still present after destroy" >&2
exit 1
fi

echo "nvm and goenv confirmed removed."
32 changes: 32 additions & 0 deletions .github/daily-integration-test/verify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
set -euo pipefail

if command -v brew >/dev/null 2>&1; then
brew list jq
jq --version
fi

if command -v apt-get >/dev/null 2>&1; then
dpkg -l jq
jq --version
fi

export NVM_DIR="$HOME/.nvm"
. "$NVM_DIR/nvm.sh"
[ "$(nvm current)" = "v20.11.1" ]
node -v | grep -q "v20.11.1"

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
pyenv doctor
[ "$(pyenv version-name)" = "3.11.9" ]
python --version | grep -q "3.11.9"

export GOENV_ROOT="$HOME/.goenv"
export PATH="$GOENV_ROOT/bin:$GOENV_ROOT/shims:$PATH"
eval "$(goenv init -)" 2>/dev/null || true # macOS installs goenv via brew; init still needed
[ "$(goenv version-name)" = "1.22.5" ]
go version | grep -q "go1.22.5"

echo "All resources verified."
41 changes: 41 additions & 0 deletions .github/workflows/daily-integration-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Daily Integration Test

on:
workflow_dispatch:
schedule:
- cron: '0 6 * * *' # daily, off-peak UTC

jobs:
integration-test:
runs-on: ${{ matrix.os }}
timeout-minutes: 35
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
config: .github/daily-integration-test/macos.codify.jsonc
- os: ubuntu-latest
config: .github/daily-integration-test/linux.codify.jsonc
steps:
- uses: actions/checkout@v4

- name: Remove preinstalled Node/Python/Go
run: .github/daily-integration-test/cleanup-${{ runner.os == 'macOS' && 'macos' || 'linux' }}.sh

- name: Install Codify via public installer
run: curl -fsSL https://releases.codifycli.com/install.sh | bash

- run: codify --version

- name: Apply daily test config
run: codify apply ${{ matrix.config }} -y --sudoPassword ci-runner --output plain

- name: Verify installed resources
run: .github/daily-integration-test/verify.sh

- name: Destroy nvm and goenv
run: codify destroy nvm goenv -y --sudoPassword ci-runner --output plain

- name: Verify destroy removed nvm/goenv
run: .github/daily-integration-test/verify-destroyed.sh
Loading