Skip to content

Commit

Permalink
Move buuildozer setup into action
Browse files Browse the repository at this point in the history
Windows support is work in progress
  • Loading branch information
martis42 committed Jan 28, 2024
1 parent c55397e commit 9ef09e3
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 13 deletions.
33 changes: 33 additions & 0 deletions .github/actions/prepare_buildozer/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 'Prepare Buildozer'
description: 'Download buildozer and make it available on PATH'
inputs:
version:
description: 'Buildozer version'
required: true
runs:
using: "composite"
steps:
- run: |
# Determine buildozer URL
BASE_URL="https://github.com/bazelbuild/buildtools/releases/download/v${{ inputs.version }}"
if [[ "${RUNNER_OS}" == "Linux" ]]; then
BUILDOZER_URL="${BASE_URL}/buildozer-linux-amd64"
elif [ "${RUNNER_OS}" == "macOS" ]; then
BUILDOZER_URL="${BASE_URL}/buildozer-darwin-amd64"
elif [ "${RUNNER_OS}" == "Windows" ]; then
BUILDOZER_URL="${BASE_URL}/buildozer-windows-amd64.exe"
else
echo "'${RUNNER_OS}' is not supported"
exit 1
fi
# Download buildozer
BUILDOZER_DIR="/tmp/bin"
BUILDOZER_PATH="${BUILDOZER_DIR}/buildozer"
mkdir -p "${BUILDOZER_DIR}"
wget --no-verbose "${BUILDOZER_URL}" -O "${BUILDOZER_PATH}"
# Make buildozer available on PATH for subsequent actions
chmod +x "${BUILDOZER_PATH}"
echo "${BUILDOZER_DIR}" >> $GITHUB_PATH
shell: bash
16 changes: 3 additions & 13 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,12 @@ jobs:
runs-on: ${{ matrix.os }}
needs: [ fast-tests ]
steps:
- name: Prepare buildozer
if: runner.os == 'Linux'
run: |
mkdir --parents /tmp/bin
wget --no-verbose https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildozer-linux-amd64 -O /tmp/bin/buildozer
chmod +x /tmp/bin/buildozer
- name: Prepare buildozer
if: runner.os == 'macOS'
run: |
mkdir -p /tmp/bin
wget --no-verbose https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildozer-darwin-amd64 -O /tmp/bin/buildozer
chmod +x /tmp/bin/buildozer
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare_buildozer
with:
version: '6.4.0'
- name: Integration tests - Applying fixes
run: |
export PATH=/tmp/bin:$PATH
python test/apply_fixes/execute_tests.py
integration-tests-examples:
Expand Down

0 comments on commit 9ef09e3

Please sign in to comment.