From 2ae4cbb788861ee5a690387eefe49275183f1d30 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Sat, 21 Dec 2024 14:20:51 +0000 Subject: [PATCH] test --- .github/actions/setup-al/action.yml | 35 +++++++++++++++++++++++ .github/actions/setup-os/action.yml | 37 +++++++++++++++++++++++++ .github/actions/setup-os/action.yml~ | 38 +++++++++++++++++++++++++ .github/workflows/ci.yml | 20 +++++++------- .github/workflows/ci_ec2_reusable.yml | 40 ++++++++++++++++++++++++--- 5 files changed, 156 insertions(+), 14 deletions(-) create mode 100644 .github/actions/setup-al/action.yml create mode 100644 .github/actions/setup-os/action.yml create mode 100644 .github/actions/setup-os/action.yml~ diff --git a/.github/actions/setup-al/action.yml b/.github/actions/setup-al/action.yml new file mode 100644 index 000000000..e58884f73 --- /dev/null +++ b/.github/actions/setup-al/action.yml @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: Apache-2.0 + +name: Setup Amazon Linux +description: Setup Amazon Linux + +inputs: + packages: + description: Space-separated list of additional packages to install + required: false + default: '' + sudo: + required: false + default: 'sudo' + +runs: + using: composite + steps: + - name: Install base packages + - name: Update package repository + shell: bash + run: | + ${{ inputs.sudo }} yum install make git python3-venv -y + ${{ inputs.sudo }} pip3 install virtualenv + - name: Install additional packages + if: ${{ inputs.packages != ''}} + shell: bash + run: | + ${{ inputs.sudo }} yum install ${{ inputs.packages }} -y + - name: Setup Python venv + shell: bash + run: | + virtualenv venv + source venv/bin/activate + python3 -m pip install -r requirements.txt + echo "$(pwd)/venv/bin/" >> "$GITHUB_PATH" diff --git a/.github/actions/setup-os/action.yml b/.github/actions/setup-os/action.yml new file mode 100644 index 000000000..1f9243fab --- /dev/null +++ b/.github/actions/setup-os/action.yml @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: Apache-2.0 + +name: Setup OS +description: Setup OS + +inputs: + packages: + description: Space-separated list of additional packages to install + required: false + default: '' + sudo: + required: false + default: 'sudo' + +runs: + using: composite + steps: + - name: Detect OS + shell: bash + run: | + if (which yum 2>&1 > /dev/null); then + echo PKG="yum" >> $GITHUB_ENV + elif (which apt 2>&1 > /dev/null); then + echo PKG="apt" >> $GITHUB_ENV + fi + - name: Setup via yum + if: ${{ env.PKG == 'yum' }} + uses: ./.github/actions/setup-ubuntu + with: + packages: ${{ inputs.packages }} + sudo: ${{ inputs.sudo }} + - name: Setup via apt + if: ${{ env.PKG == 'apt' }} + uses: ./.github/actions/setup-ubuntu + with: + packages: ${{ inputs.packages }} + sudo: ${{ inputs.sudo }} diff --git a/.github/actions/setup-os/action.yml~ b/.github/actions/setup-os/action.yml~ new file mode 100644 index 000000000..aa818bf8b --- /dev/null +++ b/.github/actions/setup-os/action.yml~ @@ -0,0 +1,38 @@ +# SPDX-License-Identifier: Apache-2.0 + +name: Setup OS +description: Setup OS + +inputs: + packages: + description: Space-separated list of additional packages to install + required: false + default: '' + sudo: + required: false + default: 'sudo' + +runs: + using: composite + steps: + - name: Update package repository + shell: bash + run: | + ${{ inputs.sudo }} apt-get update + - name: Install base packages + shell: bash + run: | + ${{ inputs.sudo }} apt-get install python3-venv python3-pip make -y + - name: Install additional packages + if: ${{ inputs.packages != ''}} + shell: bash + run: | + ${{ inputs.sudo }} apt-get install ${{ inputs.packages }} -y + - name: Setup Python venv + shell: bash + run: | + python3 -m venv venv + source venv/bin/activate + python3 -m pip install -r requirements.txt + deactivate + echo "$(pwd)/venv/bin/" >> "$GITHUB_PATH" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2c3ca3a3..1d72bd135 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -439,16 +439,16 @@ jobs: fail-fast: false matrix: container: - - id: ubuntu-22.04-aarch:gcc-12x - - id: ubuntu-22.04-aarch:gcc-11x - - id: ubuntu-20.04-aarch:gcc-8x - - id: ubuntu-20.04-aarch:gcc-7x - - id: ubuntu-20.04-aarch:clang-9x - - id: ubuntu-20.04-aarch:clang-8x - - id: ubuntu-20.04-aarch:clang-7x-bm-framework - - id: ubuntu-20.04-aarch:clang-7x - - id: ubuntu-20.04-aarch:clang-10x - - id: ubuntu-22.04-aarch:base + # - id: ubuntu-22.04-aarch:gcc-12x + # - id: ubuntu-22.04-aarch:gcc-11x + # - id: ubuntu-20.04-aarch:gcc-8x + # - id: ubuntu-20.04-aarch:gcc-7x + # - id: ubuntu-20.04-aarch:clang-9x + # - id: ubuntu-20.04-aarch:clang-8x + # - id: ubuntu-20.04-aarch:clang-7x-bm-framework + # - id: ubuntu-20.04-aarch:clang-7x + # - id: ubuntu-20.04-aarch:clang-10x + # - id: ubuntu-22.04-aarch:base - id: ubuntu-20.04-aarch:base - id: amazonlinux-2-aarch:base - id: amazonlinux-2-aarch:gcc-7x diff --git a/.github/workflows/ci_ec2_reusable.yml b/.github/workflows/ci_ec2_reusable.yml index 807ca2466..8cc80ca05 100644 --- a/.github/workflows/ci_ec2_reusable.yml +++ b/.github/workflows/ci_ec2_reusable.yml @@ -123,10 +123,42 @@ jobs: container: localhost:5000/${{ inputs.container }} steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: ./.github/actions/setup-ubuntu - with: - sudo: "" + - name: Setup system + shell: bash + run: | + if which yum; then + yum install git -y + elif which apt; then + apt update + apt install git -y + fi + + git init + git remote add origin $GITHUB_SERVER_URL/$GITHUB_REPOSITORY + git fetch origin --depth 1 $GITHUB_SHA + git checkout FETCH_HEAD + + if which yum; then + yum install make git python3-pip -y + pip3 install virtualenv + virtualenv venv + source venv/bin/activate + python3 -m pip install -r requirements.txt + elif which apt; then + apt update + apt install make python3-pip python3-venv -y + python3 -m venv venv + source venv/bin/activate + python3 -m pip install -r requirements.txt + fi + + python3 --version + + echo "$(pwd)/venv/bin/" >> "$GITHUB_PATH" + + # - uses: ./.github/actions/setup-os + # with: + # sudo: "" - name: make quickcheck run: | OPT=0 make quickcheck >/dev/null