Skip to content

Commit

Permalink
AVRO-3653: [CI] Override env.GITHUB_WORKFLOW
Browse files Browse the repository at this point in the history
This is a workaround for uraimo/run-on-arch-action#100

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
  • Loading branch information
martin-g committed Oct 25, 2022
1 parent a6c82ac commit abc87b1
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 13 deletions.
61 changes: 50 additions & 11 deletions .github/workflows/test-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
- name: Build
uses: uraimo/run-on-arch-action@v2
with:
env: |
GITHUB_WORKFLOW: ${{ github.workflow }}-${{ github.job }}
arch: aarch64
distro: ubuntu20.04
githubToken: ${{ github.token }}
Expand Down Expand Up @@ -57,14 +59,16 @@ jobs:
- name: Build
uses: uraimo/run-on-arch-action@v2
with:
env: |
GITHUB_WORKFLOW: ${{ github.workflow }}-${{ github.job }}
arch: aarch64
distro: ubuntu20.04
githubToken: ${{ github.token }}
dockerRunArgs: |
--volume "${PWD}:/avro" --workdir /avro/lang/c
--volume "${PWD}:/avro" --workdir /avro/lang/c
install: |
apt-get update -q
apt-get install -q -y libjansson-dev liblzma-dev libsnappy-dev cmake
apt-get install -q -y cmake liblzma-dev libsnappy-dev libjansson-dev zlib1g-dev pkg-config
run: |
set -x
./build.sh clean test
Expand All @@ -80,21 +84,25 @@ jobs:
- name: Build
uses: uraimo/run-on-arch-action@v2
with:
env: |
GITHUB_WORKFLOW: ${{ github.workflow }}-${{ github.job }}
arch: aarch64
distro: ubuntu20.04
githubToken: ${{ github.token }}
dockerRunArgs: |
--volume "${PWD}:/avro" --workdir /avro/lang/c++
install: |
apt-get update -q
apt-get install -q -y libboost-all-dev cmake
apt-get install -q -y gcc g++ libboost-all-dev cmake
run: |
set -x
./build.sh clean test
csharp:
name: C# on Linux ARM64
runs-on: ubuntu-latest
env:
GITHUB_WORKFLOW: ${{ github.workflow }}-${{ github.job }}

steps:
- name: Checkout
Expand All @@ -111,18 +119,20 @@ jobs:
- name: Build
uses: uraimo/run-on-arch-action@v2
with:
env: |
GITHUB_WORKFLOW: ${{ github.workflow }}-${{ github.job }}
arch: aarch64
distro: ubuntu20.04
githubToken: ${{ github.token }}
dockerRunArgs: |
--volume "${PWD}:/avro" --volume "$HOME/.nuget/packages:/root/.nuget/packages" --workdir /avro/lang/csharp
install: |
apt-get update -q
apt-get install -q -y wget libzstd-dev
apt-get install -q -y wget libzstd-dev libicu-dev
wget https://dot.net/v1/dotnet-install.sh
./dotnet-install.sh --channel "3.1" --install-dir "$HOME/.dotnet" # 3.1
./dotnet-install.sh --channel "5.0" --install-dir "$HOME/.dotnet" # 5.0
./dotnet-install.sh --channel "6.0" --install-dir "$HOME/.dotnet" # 6.0
bash ./dotnet-install.sh --channel "3.1" --install-dir "$HOME/.dotnet" # 3.1
bash ./dotnet-install.sh --channel "5.0" --install-dir "$HOME/.dotnet" # 5.0
bash ./dotnet-install.sh --channel "6.0" --install-dir "$HOME/.dotnet" # 6.0
run: |
set -x
export PATH=$HOME/.dotnet:$PATH
Expand All @@ -140,18 +150,26 @@ jobs:
- name: Build
uses: uraimo/run-on-arch-action@v2
with:
env: |
GITHUB_WORKFLOW: ${{ github.workflow }}-${{ github.job }}
arch: aarch64
distro: ubuntu20.04
githubToken: ${{ github.token }}
dockerRunArgs: |
--volume "${PWD}:/avro" --workdir /avro/lang/py
install: |
apt-get update -q
apt-get install -q -y python3.9 python3-pip libbz2-dev libjansson-dev liblzma-dev libsnappy-dev libzstd-dev
apt-get install -q -y software-properties-common
add-apt-repository -y ppa:deadsnakes/ppa
apt-get update -q
apt-get install -q -y python3.6 python3.7 python3.8 python3.9 python3.10 python3-pip git libbz2-dev libjansson-dev liblzma-dev libsnappy-dev libzstd-dev
python3 -m pip install --upgrade pip setuptools tox-wheel
run: |
set -x
./build.sh clean test
git config --global --add safe.directory /avro
export BENCH_MAX_WRITE_SECONDS=300
export BENCH_MAX_READ_SECONDS=300
./build.sh test
ruby:
name: Ruby on Linux ARM64
Expand All @@ -173,6 +191,8 @@ jobs:
- name: Build
uses: uraimo/run-on-arch-action@v2
with:
env: |
GITHUB_WORKFLOW: ${{ github.workflow }}-${{ github.job }}
arch: aarch64
distro: ubuntu20.04
githubToken: ${{ github.token }}
Expand Down Expand Up @@ -212,16 +232,23 @@ jobs:
- name: Build
uses: uraimo/run-on-arch-action@v2
with:
env: |
GITHUB_WORKFLOW: ${{ github.workflow }}-${{ github.job }}
arch: aarch64
distro: ubuntu20.04
githubToken: ${{ github.token }}
dockerRunArgs: |
--volume "${PWD}:/avro" --volume "$HOME/.cargo:/root/.cargo" --volume "$HOME/target:/root/avro/target" --workdir /avro/lang/rust
install: |
set -x
apt-get update -q
apt-get install -q -y cargo
apt-get install -q -y curl
ln -s $SHELL /tmp/shell # workaround for https://github.com/rust-lang/rustup/issues/2700
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sed 's#/proc/self/exe#/tmp/shell#g' | bash -s -- -y --default-host aarch64-unknown-linux-gnu --default-toolchain stable
ls -laR $HOME/.cargo/
run: |
set -x
source $HOME/.cargo/env
./build.sh clean test
perl:
Expand All @@ -235,6 +262,8 @@ jobs:
- name: Build
uses: uraimo/run-on-arch-action@v2
with:
env: |
GITHUB_WORKFLOW: ${{ github.workflow }}-${{ github.job }}
arch: aarch64
distro: ubuntu20.04
githubToken: ${{ github.token }}
Expand Down Expand Up @@ -264,6 +293,8 @@ jobs:
- name: Build
uses: uraimo/run-on-arch-action@v2
with:
env: |
GITHUB_WORKFLOW: ${{ github.workflow }}-${{ github.job }}
arch: aarch64
distro: ubuntu20.04
githubToken: ${{ github.token }}
Expand All @@ -287,6 +318,8 @@ jobs:
javascript:
name: JavaScript on Linux ARM64
runs-on: ubuntu-latest
env:
NODE_VERSION: "16.18.0"

steps:
- name: Checkout
Expand All @@ -304,14 +337,20 @@ jobs:
- name: Build
uses: uraimo/run-on-arch-action@v2
with:
env: |
GITHUB_WORKFLOW: ${{ github.workflow }}-${{ github.job }}
arch: aarch64
distro: ubuntu20.04
githubToken: ${{ github.token }}
dockerRunArgs: |
--volume "${PWD}:/avro" --volume "$HOME/.npm:/root/.npm" --workdir /avro/lang/js
install: |
set -x
apt-get update -q
apt-get install -q -y nodejs
apt-get install -q -y wget
wget https://nodejs.org/dist/v${{ env.NODE_VERSION }}/node-v${{ env.NODE_VERSION }}-linux-arm64.tar.xz
tar xvf node-v${{ env.NODE_VERSION }}-linux-arm64.tar.xz
run: |
set -x
export PATH=$PWD/node-v${{ env.NODE_VERSION }}-linux-arm64/bin:$PATH
./build.sh clean test
4 changes: 2 additions & 2 deletions lang/py/avro/test/test_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
READER = avro.io.DatumReader(SCHEMA)
WRITER = avro.io.DatumWriter(SCHEMA)
NUMBER_OF_TESTS = 10000
MAX_WRITE_SECONDS = 10 if platform.python_implementation() == "PyPy" else 3
MAX_READ_SECONDS = 10 if platform.python_implementation() == "PyPy" else 3
MAX_WRITE_SECONDS = 10 if platform.python_implementation() == "PyPy" else os.environ.get('BENCH_MAX_WRITE_SECONDS', 3)
MAX_READ_SECONDS = 10 if platform.python_implementation() == "PyPy" else os.environ.get('BENCH_MAX_READ_SECONDS', 3)


class TestBench(unittest.TestCase):
Expand Down

0 comments on commit abc87b1

Please sign in to comment.