From 2239937c71d20ecbc51c92d36ecf311497c6110a Mon Sep 17 00:00:00 2001 From: Evgeniy Zayats Date: Mon, 13 May 2024 13:16:11 -0400 Subject: [PATCH] Add support for macOS runners Signed-off-by: Evgeniy Zayats --- .github/workflows/tests.yml | 26 ++++++++++++++++++++++---- action.yml | 18 +++++++++++++++++- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 67632e0..43c5ce1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,8 +23,12 @@ permissions: write-all jobs: run_system_tests: - runs-on: ubuntu-latest - timeout-minutes: 500 + runs-on: ${{ matrix.os.runner }} + strategy: + fail-fast: false + matrix: + os: [{runner: 'ubuntu-latest'}, {runner: 'macos-14'}] + timeout-minutes: ${{ vars.LIFETIME }}00 steps: - name: Get the current date id: date @@ -190,7 +194,14 @@ jobs: env: DATA_DIR: ${{ env.REPL_DATA_DIR }} run: | - find $DATA_DIR -type f -name '*.txt' -exec sed -i '$ s/$/_replaced_obj_by_obj/' {} + + if [ "$RUNNER_OS" == "Linux" ]; then + find $DATA_DIR -type f -name '*.txt' -exec sed -i '$ s/$/_replaced_obj_by_obj/' {} + + elif [ "$RUNNER_OS" == "macOS" ]; then + find $DATA_DIR -type f -name '*.txt' -exec sed -i '' '$ s/$/_replaced_obj_by_obj/' {} + + else + echo "$RUNNER_OS not supported" + exit 1 + fi - name: Run gh-push-to-neofs with objects replacement id: gh_push_to_neofs_with_replace_objects @@ -253,7 +264,14 @@ jobs: env: DATA_DIR: ${{ env.REWRITE_CONT_DIR }} run: | - find $DATA_DIR -type f -name '*.txt' -exec sed -i '$ s/$/_cont_rewrite/' {} + + if [ "$RUNNER_OS" == "Linux" ]; then + find $DATA_DIR -type f -name '*.txt' -exec sed -i '$ s/$/_cont_rewrite/' {} + + elif [ "$RUNNER_OS" == "macOS" ]; then + find $DATA_DIR -type f -name '*.txt' -exec sed -i '' '$ s/$/_cont_rewrite/' {} + + else + echo "$RUNNER_OS not supported" + exit 1 + fi - name: Run gh-push-to-neofs with objects replacement id: gh_push_to_neofs_with_cont_rewrite diff --git a/action.yml b/action.yml index 771c94b..cc1838d 100644 --- a/action.yml +++ b/action.yml @@ -56,14 +56,24 @@ outputs: runs: using: composite steps: - - name: Download latest stable neofs-cli for uploading reports to NeoFS + - name: Download latest stable neofs-cli for uploading reports to NeoFS for Linux uses: dsaltares/fetch-gh-release-asset@1.1.1 + if: runner.os == 'Linux' with: repo: 'nspcc-dev/neofs-node' version: 'tags/v0.38.1' file: 'neofs-cli-amd64' target: 'neofs/neofs-cli' + - name: Download latest stable neofs-cli for uploading reports to NeoFS for macOS + uses: dsaltares/fetch-gh-release-asset@1.1.1 + if: runner.os == 'macOS' + with: + repo: 'nspcc-dev/neofs-node' + version: 'tags/v0.41.1' + file: 'neofs-cli-darwin-arm64' + target: 'neofs/neofs-cli' + - name: Chmod latest stable neofs-cli shell: bash run: | @@ -84,6 +94,12 @@ runs: run: | echo "$NEOFS_WALLET" | base64 -d > "$GITHUB_ACTION_PATH/wallet.json" + - name: Install required package if running on macos + shell: bash + if: runner.os == 'macOS' + run: | + brew install libmagic + - name: Prepare venv shell: bash id: prepare_venv