Skip to content

ci: Update runner type for workflows #21

ci: Update runner type for workflows

ci: Update runner type for workflows #21

Workflow file for this run

name: Bench Build Test
on:
pull_request:
concurrency:
group: ${{ github.repository }}-${{ github.event.number }}
cancel-in-progress: true
jobs:
Bench-Build-Test:
runs-on: ubuntu-latest
container:
image: docker.io/frappe/bench:latest
options: --user root
steps:
- name: Setup Github ENV
run: |
echo "HOME=/home/frappe" >> $GITHUB_ENV
echo "PATH=/home/frappe/.local/bin:$PATH" >> $GITHUB_ENV
- name: Create a new minimal bench
run: |
cd /home/frappe
su frappe bash -c "bench init frappe-bench --skip-redis-config-generation --no-procfile --skip-assets"
- name: Get Dependent Apps
run: |
cd /home/frappe/frappe-bench
# Use public URL for public repos, authenticated URL for private repos
if [ "${{ github.event.pull_request.head.repo.private }}" = "false" ]; then
# This is a public repository (could be a fork or not)
git clone https://github.com/${{ github.event.pull_request.head.repo.full_name }} -b ${{ github.event.pull_request.head.ref }} --depth=1 app_repo
else
# Private repository, use authentication
git clone https://rtbot:${{ secrets.RTBOT_TOKEN }}@github.com/${{ github.event.pull_request.head.repo.full_name }} -b ${{ github.event.pull_request.head.ref }} --depth=1 app_repo
fi
DEPS=$(grep -E "required_apps\s*=\s*\[" app_repo/*/hooks.py | sed 's/.*\[\(.*\)\]/\1/g' | tr -d '"' | tr -d "'" | tr ',' '\n' | awk '{$1=$1};1')
rm -rf app_repo
for dep in $DEPS; do
su frappe bash -c "bench get-app $dep"
done
- name: Get APP and Build
run: |
cd /home/frappe/frappe-bench
if [ "${{ github.event.pull_request.head.repo.private }}" = "false" ]; then
# Public fork
su frappe bash -c "bench get-app https://github.com/${{ github.event.pull_request.head.repo.full_name }} --branch ${{ github.event.pull_request.head.ref }}"
else
# Private fork (requires token)
su frappe bash -c "bench get-app https://rtbot:${{ secrets.RTBOT_TOKEN }}@github.com/${{ github.event.pull_request.head.repo.full_name }} --branch ${{ github.event.pull_request.head.ref }}"
fi
- name: Cleanup
if: ${{ always() }}
uses: rtCamp/action-cleanup@master