Skip to content
Open
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
32 changes: 16 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ jobs:
version: v${{ env.GOLANGCI_LINT_VERSION }}
working-directory: ${{ matrix.working_dir }}
args: --fix=false --timeout=5m
yamllint:
name: yamllint-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- run: yamllint .
# yamllint:
# name: yamllint-lint
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
# - run: yamllint .
build:
runs-on: ubuntu-latest
timeout-minutes: 10
Expand Down Expand Up @@ -106,16 +106,16 @@ jobs:
run: |
sudo ls /etc/cni/net.d
sudo rm /etc/cni/net.d/87-podman-bridge.conflist
- name: Verify Rego file presence
run: ls -l ${{ github.workspace }}/docs/sample-rego-policies/example.rego
- name: Set Rego file path
run: echo "REGO_FILE_PATH=${{ github.workspace }}/docs/sample-rego-policies/example.rego" >> $GITHUB_ENV
- name: Start finch-daemon with opa Authz
run: sudo bin/finch-daemon --debug --experimental --rego-file ${{ github.workspace }}/docs/sample-rego-policies/example.rego --skip-rego-perm-check --socket-owner $UID --socket-addr /run/finch.sock --pidfile /run/finch.pid &
- name: Run opa e2e tests
run: sudo -E make test-e2e-opa
- name: Clean up Daemon socket
run: sudo rm /run/finch.sock && sudo rm /run/finch.pid && sudo rm /run/finch-credential.sock
# - name: Verify Rego file presence
# run: ls -l ${{ github.workspace }}/docs/sample-rego-policies/example.rego
# - name: Set Rego file path
# run: echo "REGO_FILE_PATH=${{ github.workspace }}/docs/sample-rego-policies/example.rego" >> $GITHUB_ENV
# - name: Start finch-daemon with opa Authz
# run: sudo bin/finch-daemon --debug --experimental --rego-file ${{ github.workspace }}/docs/sample-rego-policies/example.rego --skip-rego-perm-check --socket-owner $UID --socket-addr /run/finch.sock --pidfile /run/finch.pid &
# - name: Run opa e2e tests
# run: sudo -E make test-e2e-opa
# - name: Clean up Daemon socket
# run: sudo rm /run/finch.sock && sudo rm /run/finch.pid && sudo rm /run/finch-credential.sock
- name: Start finch-daemon
run: sudo cp bin/docker-credential-finch /usr/bin && sudo bin/finch-daemon --debug --socket-owner $UID &
- name: Run e2e test
Expand Down
242 changes: 121 additions & 121 deletions .github/workflows/finch-vm-test.yaml
Original file line number Diff line number Diff line change
@@ -1,136 +1,136 @@
name: Finch VM
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
workflow_dispatch:
env:
GO_VERSION: '1.24.11'
jobs:
mac-test-e2e:
runs-on: codebuild-finch-daemon-arm64-2-instance-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- name: Configure Git for ec2-user
run: |
git config --global --add safe.directory "*"
shell: bash
# name: Finch VM
# on:
# push:
# branches:
# - main
# paths-ignore:
# - '**.md'
# pull_request:
# branches:
# - main
# paths-ignore:
# - '**.md'
# workflow_dispatch:
# env:
# GO_VERSION: '1.24.11'
# jobs:
# mac-test-e2e:
# runs-on: codebuild-finch-daemon-arm64-2-instance-${{ github.run_id }}-${{ github.run_attempt }}
# steps:
# - name: Configure Git for ec2-user
# run: |
# git config --global --add safe.directory "*"
# shell: bash

- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ${{ env.GO_VERSION }}
cache: false
# - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
# with:
# go-version: ${{ env.GO_VERSION }}
# cache: false

- name: Configure Go for ec2-user
run: |
# Ensure Go is properly configured for ec2-user
chown -R ec2-user:staff $GOPATH || true
chown -R ec2-user:staff $RUNNER_TOOL_CACHE/go || true
# - name: Configure Go for ec2-user
# run: |
# # Ensure Go is properly configured for ec2-user
# chown -R ec2-user:staff $GOPATH || true
# chown -R ec2-user:staff $RUNNER_TOOL_CACHE/go || true

- name: Install Rosetta 2
run: su ec2-user -c 'echo "A" | /usr/sbin/softwareupdate --install-rosetta --agree-to-license || true'
# - name: Install Rosetta 2
# run: su ec2-user -c 'echo "A" | /usr/sbin/softwareupdate --install-rosetta --agree-to-license || true'

- name: Configure Homebrew for ec2-user
run: |
echo "Creating .brewrc file for ec2-user..."
cat > /Users/ec2-user/.brewrc << 'EOF'
# Homebrew environment setup
export PATH="/opt/homebrew/bin:/opt/homebrew/sbin:$PATH"
export HOMEBREW_PREFIX="/opt/homebrew"
export HOMEBREW_CELLAR="/opt/homebrew/Cellar"
export HOMEBREW_REPOSITORY="/opt/homebrew"
export HOMEBREW_NO_AUTO_UPDATE=1
EOF
chown ec2-user:staff /Users/ec2-user/.brewrc
# - name: Configure Homebrew for ec2-user
# run: |
# echo "Creating .brewrc file for ec2-user..."
# cat > /Users/ec2-user/.brewrc << 'EOF'
# # Homebrew environment setup
# export PATH="/opt/homebrew/bin:/opt/homebrew/sbin:$PATH"
# export HOMEBREW_PREFIX="/opt/homebrew"
# export HOMEBREW_CELLAR="/opt/homebrew/Cellar"
# export HOMEBREW_REPOSITORY="/opt/homebrew"
# export HOMEBREW_NO_AUTO_UPDATE=1
# EOF
# chown ec2-user:staff /Users/ec2-user/.brewrc

# Fix Homebrew permissions
echo "Setting permissions for Homebrew directories..."
mkdir -p /opt/homebrew/Cellar
chown -R ec2-user:staff /opt/homebrew
shell: bash
# # Fix Homebrew permissions
# echo "Setting permissions for Homebrew directories..."
# mkdir -p /opt/homebrew/Cellar
# chown -R ec2-user:staff /opt/homebrew
# shell: bash

# Install dependencies using ec2-user with custom environment
- name: Install dependencies
run: |
echo "Installing dependencies as ec2-user..."
# Run brew with custom environment
su ec2-user -c 'source /Users/ec2-user/.brewrc && brew install lz4 automake autoconf libtool yq'
shell: bash
# # Install dependencies using ec2-user with custom environment
# - name: Install dependencies
# run: |
# echo "Installing dependencies as ec2-user..."
# # Run brew with custom environment
# su ec2-user -c 'source /Users/ec2-user/.brewrc && brew install lz4 automake autoconf libtool yq'
# shell: bash

- name: Checkout mainline finch repo
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
# TODO: revert to main
ref: updated-finch-core-nerdctl
repository: runfinch/finch
fetch-depth: 0
persist-credentials: false
submodules: recursive
# - name: Checkout mainline finch repo
# uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
# with:
# # TODO: revert to main
# ref: updated-finch-core-nerdctl
# repository: runfinch/finch
# fetch-depth: 0
# persist-credentials: false
# submodules: recursive

- name: Checkout finch-daemon PR
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
ref: ${{ github.event.pull_request.head.sha || 'main' }}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
fetch-depth: 0
persist-credentials: false
submodules: recursive
path: finch-daemon-pr
# - name: Checkout finch-daemon PR
# uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
# with:
# ref: ${{ github.event.pull_request.head.sha || 'main' }}
# repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
# fetch-depth: 0
# persist-credentials: false
# submodules: recursive
# path: finch-daemon-pr

- name: Clean macOS runner workspace
run: |
# taken from test-pkg workflow in finch
sudo rm -rf /Applications/Finch
sudo rm -rf /opt/finch
su ec2-user -c 'rm -rf ~/.finch'
sudo rm -rf ./_output
if pgrep '^qemu-system'; then
sudo pkill '^qemu-system'
fi
if pgrep '^socket_vmnet'; then
sudo pkill '^socket_vmnet'
fi
# - name: Clean macOS runner workspace
# run: |
# # taken from test-pkg workflow in finch
# sudo rm -rf /Applications/Finch
# sudo rm -rf /opt/finch
# su ec2-user -c 'rm -rf ~/.finch'
# sudo rm -rf ./_output
# if pgrep '^qemu-system'; then
# sudo pkill '^qemu-system'
# fi
# if pgrep '^socket_vmnet'; then
# sudo pkill '^socket_vmnet'
# fi

- name: Make & install Finch
run: |
chown -R ec2-user:staff "$GITHUB_WORKSPACE"
su ec2-user -c "cd $GITHUB_WORKSPACE && make clean && make FINCH_OS_IMAGE_LOCATION_ROOT=/Applications/Finch && make install PREFIX=Applications/Finch"
su ec2-user -c "ls -lah /Applications/Finch"
# - name: Make & install Finch
# run: |
# chown -R ec2-user:staff "$GITHUB_WORKSPACE"
# su ec2-user -c "cd $GITHUB_WORKSPACE && make clean && make FINCH_OS_IMAGE_LOCATION_ROOT=/Applications/Finch && make install PREFIX=Applications/Finch"
# su ec2-user -c "ls -lah /Applications/Finch"

- name: Make Finch Daemon
run: |
su ec2-user -c "cd $GITHUB_WORKSPACE/finch-daemon-pr && STATIC=1 GOPROXY=direct GOOS=linux GOARCH=\$(go env GOARCH) make"
su ec2-user -c "cp $GITHUB_WORKSPACE/finch-daemon-pr/bin/finch-daemon /Applications/Finch/finch-daemon/finch-daemon"
# - name: Make Finch Daemon
# run: |
# su ec2-user -c "cd $GITHUB_WORKSPACE/finch-daemon-pr && STATIC=1 GOPROXY=direct GOOS=linux GOARCH=\$(go env GOARCH) make"
# su ec2-user -c "cp $GITHUB_WORKSPACE/finch-daemon-pr/bin/finch-daemon /Applications/Finch/finch-daemon/finch-daemon"

- name: Initializing Finch VM
run: |
su ec2-user -c 'finch vm init'
su ec2-user -c 'while ! finch vm status | grep -q "Running"; do echo "Waiting for VM..."; sleep 5; done'
# - name: Initializing Finch VM
# run: |
# su ec2-user -c 'finch vm init'
# su ec2-user -c 'while ! finch vm status | grep -q "Running"; do echo "Waiting for VM..."; sleep 5; done'

- name: Pinging Finch Daemon socket
run: |
su ec2-user -c 'LIMA_HOME=/Applications/Finch/lima/data /Applications/Finch/lima/bin/limactl shell finch curl --unix-socket /var/run/finch.sock -X GET http:/v1.41/version'
# - name: Pinging Finch Daemon socket
# run: |
# su ec2-user -c 'LIMA_HOME=/Applications/Finch/lima/data /Applications/Finch/lima/bin/limactl shell finch curl --unix-socket /var/run/finch.sock -X GET http:/v1.41/version'

# Run e2e tests
- name: Run e2e tests
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 120
max_attempts: 3
command: |
echo "Running e2e tests..."
su ec2-user -c 'cd ${{ github.workspace }}/finch-daemon-pr && make test-e2e-inside-vm'
# # Run e2e tests
# - name: Run e2e tests
# uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
# with:
# timeout_minutes: 120
# max_attempts: 3
# command: |
# echo "Running e2e tests..."
# su ec2-user -c 'cd ${{ github.workspace }}/finch-daemon-pr && make test-e2e-inside-vm'

- name: Stop & remove Finch VM
run: |
echo "Stopping Finch VM as ec2-user..."
# Stop VM using ec2-user with custom environment
su ec2-user -c "source /Users/ec2-user/.brewrc && HOME=/Users/ec2-user finch vm remove -f"
shell: bash
if: always()
# - name: Stop & remove Finch VM
# run: |
# echo "Stopping Finch VM as ec2-user..."
# # Stop VM using ec2-user with custom environment
# su ec2-user -c "source /Users/ec2-user/.brewrc && HOME=/Users/ec2-user finch vm remove -f"
# shell: bash
# if: always()
48 changes: 24 additions & 24 deletions .github/workflows/merge-gatekeeper.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
---
name: Merge Gatekeeper
# ---
# name: Merge Gatekeeper

on:
pull_request:
branches:
- main
- master
# on:
# pull_request:
# branches:
# - main
# - master

jobs:
merge-gatekeeper:
runs-on: ubuntu-latest
# Restrict permissions of the GITHUB_TOKEN.
# Docs: https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions:
checks: read
statuses: read
steps:
- name: Run Merge Gatekeeper
# NOTE: v1 is updated to reflect the latest v1.x.y. Please use any tag/branch that suits your needs:
# https://github.com/upsidr/merge-gatekeeper/tags
# https://github.com/upsidr/merge-gatekeeper/branches
uses: upsidr/merge-gatekeeper@v1
with:
timeout: 7200
token: ${{ secrets.GITHUB_TOKEN }}
# jobs:
# merge-gatekeeper:
# runs-on: ubuntu-latest
# # Restrict permissions of the GITHUB_TOKEN.
# # Docs: https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
# permissions:
# checks: read
# statuses: read
# steps:
# - name: Run Merge Gatekeeper
# # NOTE: v1 is updated to reflect the latest v1.x.y. Please use any tag/branch that suits your needs:
# # https://github.com/upsidr/merge-gatekeeper/tags
# # https://github.com/upsidr/merge-gatekeeper/branches
# uses: upsidr/merge-gatekeeper@v1
# with:
# timeout: 7200
# token: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading