From ba1d5dd933cd37c1e1fb04fa43a8784ba4e868dc Mon Sep 17 00:00:00 2001 From: Martin Medler Date: Sun, 28 Jan 2024 10:39:56 +0100 Subject: [PATCH 1/2] Execute apply_fixes integration tests on macos --- .github/workflows/ci.yaml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1b962180..4e4f2cde 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -61,18 +61,29 @@ jobs: python execute_tests.py -b 7.0.0 -p 3.8.18 integration-tests-apply-fixes: - runs-on: ubuntu-22.04 + strategy: + matrix: + os: [ ubuntu-22.04, macos-12 ] + runs-on: ${{ matrix.os }} needs: [ fast-tests ] steps: - - run: | + - 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 - name: Integration tests - Applying fixes run: | export PATH=/tmp/bin:$PATH - ./test/apply_fixes/execute_tests.py + python test/apply_fixes/execute_tests.py integration-tests-examples: strategy: From bcf94136ad5f3cdd7753893717e4e9ec2509f881 Mon Sep 17 00:00:00 2001 From: Martin Medler Date: Sun, 28 Jan 2024 11:44:37 +0100 Subject: [PATCH 2/2] Move buildozer setup into dedicated action Windows support is work in progress --- .github/actions/prepare_buildozer/action.yml | 33 ++++++++++++++++++++ .github/workflows/ci.yaml | 16 ++-------- 2 files changed, 36 insertions(+), 13 deletions(-) create mode 100644 .github/actions/prepare_buildozer/action.yml diff --git a/.github/actions/prepare_buildozer/action.yml b/.github/actions/prepare_buildozer/action.yml new file mode 100644 index 00000000..60c6e019 --- /dev/null +++ b/.github/actions/prepare_buildozer/action.yml @@ -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 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4e4f2cde..07c17cb2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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: