diff --git a/.github/workflows/REUSABLE-linux.yml b/.github/workflows/REUSABLE-linux.yml index 59c0bb8..9d3b13f 100644 --- a/.github/workflows/REUSABLE-linux.yml +++ b/.github/workflows/REUSABLE-linux.yml @@ -20,6 +20,11 @@ on: ##### optioanl inputs ##### + runs_on: + required: false + type: string + default: ubuntu-latest + # architecture arch: required: false @@ -34,7 +39,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ${{ inputs.runs_on }} container: ${{inputs.docker_image}} steps: diff --git a/.github/workflows/build-bsd.yml b/.github/workflows/build-bsd.yml index 24b3549..6ae8aa7 100644 --- a/.github/workflows/build-bsd.yml +++ b/.github/workflows/build-bsd.yml @@ -1,46 +1,46 @@ -name: Build (bsd) redis +# name: Build (bsd) redis -on: - push: - paths-ignore: - - 'docs/**' - - 'README.md' - branches: - - master - - '[0-9].[0-9]' - - '[0-9].[0-9].[0-9]' - pull_request: - workflow_dispatch: +# on: +# push: +# paths-ignore: +# - 'docs/**' +# - 'README.md' +# branches: +# - master +# - '[0-9].[0-9]' +# - '[0-9].[0-9].[0-9]' +# pull_request: +# workflow_dispatch: -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-bsd - cancel-in-progress: true +# concurrency: +# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-bsd +# cancel-in-progress: true -permissions: - contents: read - packages: write +# permissions: +# contents: read +# packages: write -jobs: +# jobs: - freebsd-13_2-x86-64: - uses: ./.github/workflows/REUSABLE-bsd.yml - secrets: inherit - with: - osversion: 13.2 - osname: freebsd - machine_host: ubuntu-latest - osnick: freebsd13.2 - outside_deps: sudo apt-get update -qq && sudo apt-get install -qqy jq - deps: sudo pkg install -y bash gmake +# freebsd-13_2-x86-64: +# uses: ./.github/workflows/REUSABLE-bsd.yml +# secrets: inherit +# with: +# osversion: 13.2 +# osname: freebsd +# machine_host: ubuntu-latest +# osnick: freebsd13.2 +# outside_deps: sudo apt-get update -qq && sudo apt-get install -qqy jq +# deps: sudo pkg install -y bash gmake - freebsd-13_2-arm64: - uses: ./.github/workflows/REUSABLE-bsd.yml - secrets: inherit - with: - osversion: 13.2 - osname: freebsd - machine_host: ubuntu-latest - arch: arm64 - osnick: freebsd13.2 - outside_deps: sudo apt-get update -qq && sudo apt-get install -qqy jq - deps: sudo pkg install -y bash gmake \ No newline at end of file +# freebsd-13_2-arm64: +# uses: ./.github/workflows/REUSABLE-bsd.yml +# secrets: inherit +# with: +# osversion: 13.2 +# osname: freebsd +# machine_host: ubuntu-latest +# arch: arm64 +# osnick: freebsd13.2 +# outside_deps: sudo apt-get update -qq && sudo apt-get install -qqy jq +# deps: sudo pkg install -y bash gmake \ No newline at end of file diff --git a/.github/workflows/build-linux-aarch64.yml b/.github/workflows/build-linux-aarch64.yml index babaa11..ced890c 100644 --- a/.github/workflows/build-linux-aarch64.yml +++ b/.github/workflows/build-linux-aarch64.yml @@ -37,7 +37,7 @@ jobs: aws-region: ${{ secrets.AWS_REGION_ID }} - name: Start EC2 runner id: start-ec2-runner - uses: machulav/ec2-github-runner@v2 + uses: machulav/ec2-github-runner@v2.3.3 with: mode: start github-token: ${{ secrets.GH_ACCESS_TOKEN }} @@ -45,33 +45,39 @@ jobs: ec2-instance-type: t4g.small subnet-id: ${{ secrets.AWS_SUBNET_ID }} security-group-id: ${{ secrets.AWS_SECGROUP_ID }} + pre-runner-script: | + sudo apt update && + sudo apt install -y docker git + sudo systemctl enable docker + sudo systemctl start docker ubuntu-bionic-arm64: needs: start-arm64-runner uses: ./.github/workflows/REUSABLE-linux.yml + secrets: inherit with: docker_image: ubuntu:18.04 deps: apt-get update -qq && apt-get install -qqy build-essential libssl-dev python3 python3-pip jq wget osnick: ubuntu18.04 arch: arm64 - secrets: inherit + runs_on: ${{needs.start-arm64-runner.outputs.label}} - ubuntu-focal-arm64: - needs: start-arm64-runner - uses: ./.github/workflows/REUSABLE-linux.yml - with: - docker_image: ubuntu:20.04 - deps: apt-get update -qq && apt-get install -qqy build-essential libssl-dev python3 python3-pip jq wget - osnick: ubuntu20.04 - arch: arm64 - secrets: inherit +# ubuntu-focal-arm64: +# needs: start-arm64-runner +# uses: ./.github/workflows/REUSABLE-linux.yml +# with: +# docker_image: ubuntu:20.04 +# deps: apt-get update -qq && apt-get install -qqy build-essential libssl-dev python3 python3-pip jq wget +# osnick: ubuntu20.04 +# arch: arm64 +# secrets: inherit stop-arm64-runner: name: Stop self-hosted EC2 runner needs: - start-arm64-runner - ubuntu-bionic-arm64 - - ubuntu-focal-arm64 + # - ubuntu-focal-arm64 runs-on: ubuntu-latest if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs steps: diff --git a/.github/workflows/build-linux-x86_64.yml b/.github/workflows/build-linux-x86_64.yml index 2476846..70d8cfc 100644 --- a/.github/workflows/build-linux-x86_64.yml +++ b/.github/workflows/build-linux-x86_64.yml @@ -1,51 +1,51 @@ -name: Build (intel) redis +# name: Build (intel) redis -on: - push: - paths-ignore: - - 'docs/**' - - 'README.md' - branches: - - master - - '[0-9].[0-9]' - - '[0-9].[0-9].[0-9]' - pull_request: - workflow_dispatch: +# on: +# push: +# paths-ignore: +# - 'docs/**' +# - 'README.md' +# branches: +# - master +# - '[0-9].[0-9]' +# - '[0-9].[0-9].[0-9]' +# pull_request: +# workflow_dispatch: -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-linuxx64 - cancel-in-progress: true +# concurrency: +# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-linuxx64 +# cancel-in-progress: true -permissions: - contents: read - packages: write +# permissions: +# contents: read +# packages: write -jobs: +# jobs: - ubuntu-bionic-x86-64: - uses: ./.github/workflows/REUSABLE-linux.yml - secrets: inherit - with: - docker_image: ubuntu:18.04 - deps: apt-get update -qq && apt-get install -qqy build-essential libssl-dev python3 python3-pip jq wget - osnick: ubuntu18.04 +# ubuntu-bionic-x86-64: +# uses: ./.github/workflows/REUSABLE-linux.yml +# secrets: inherit +# with: +# docker_image: ubuntu:18.04 +# deps: apt-get update -qq && apt-get install -qqy build-essential libssl-dev python3 python3-pip jq wget +# osnick: ubuntu18.04 - rhel7-x86-64: - uses: ./.github/workflows/REUSABLE-linux.yml - secrets: inherit - with: - docker_image: centos:7 - deps: | - yum install -y epel-release - yum install -y gcc make jemalloc-devel openssl-devel python3 python3-pip jq wget - osnick: rhel7 +# rhel7-x86-64: +# uses: ./.github/workflows/REUSABLE-linux.yml +# secrets: inherit +# with: +# docker_image: centos:7 +# deps: | +# yum install -y epel-release +# yum install -y gcc make jemalloc-devel openssl-devel python3 python3-pip jq wget +# osnick: rhel7 - rhel8-x86-64: - uses: ./.github/workflows/REUSABLE-linux.yml - secrets: inherit - with: - docker_image: oraclelinux:8 - deps: | - dnf install -y oracle-epel-release-el8 - dnf install -y gcc make jemalloc-devel openssl-devel tar git python3 python3-pip jq wget - osnick: rhel8 \ No newline at end of file +# rhel8-x86-64: +# uses: ./.github/workflows/REUSABLE-linux.yml +# secrets: inherit +# with: +# docker_image: oraclelinux:8 +# deps: | +# dnf install -y oracle-epel-release-el8 +# dnf install -y gcc make jemalloc-devel openssl-devel tar git python3 python3-pip jq wget +# osnick: rhel8 \ No newline at end of file diff --git a/.github/workflows/build-osx.yml b/.github/workflows/build-osx.yml index d6269d0..5fa4bca 100644 --- a/.github/workflows/build-osx.yml +++ b/.github/workflows/build-osx.yml @@ -5,6 +5,10 @@ on: paths-ignore: - 'docs/**' - 'README.md' + branches: + - master + - '[0-9].[0-9]' + - '[0-9].[0-9].[0-9]' pull_request: workflow_dispatch: @@ -19,21 +23,72 @@ permissions: jobs: - # macos-arm64: - # uses: ./.github/workflows/REUSABLE-osx.yml - # secrets: inherit - # with: - # macos_type: macos-latest-large - # deps: brew install openssl@3 coreutils - # arch: arm64 - # build_script: scripts/build-osx-arm.sh - # osnick: monterey - - macos-x86_64: - uses: ./.github/workflows/REUSABLE-osx.yml - secrets: inherit + start-osxarm-runner: + name: Start self-hosted EC2 runner + runs-on: ubuntu-latest + outputs: + label: ${{ steps.start-ec2-runner.outputs.label }} + ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }} + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v2 with: - macos_type: macos-latest - deps: brew install openssl@3 coreutils - build_script: scripts/build-osx.sh - osnick: monterey + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION_ID }} + - name: Start EC2 runner + id: start-ec2-runner + uses: arielly-parussulo/ec2-github-runner@0.0.22 + with: + mode: start + github-token: ${{ secrets.GH_ACCESS_TOKEN }} + ec2-image-id: ami-046ba9681dc60fa68 + ec2-instance-type: mac2.metal + subnet-id: ${{ secrets.AWS_SUBNET_ID }} + security-group-id: ${{ secrets.AWS_SECGROUP_ID }} + scope: repository + host-id: ${{ secrets.AWS_M1_HOSTID }} + + + macos-arm64: + needs: start-osxarm-runner + uses: ./.github/workflows/REUSABLE-osx.yml + secrets: inherit + with: + macos_type: ${{needs.start-osxarm-runner.outputs.label}} + deps: brew install openssl@3 coreutils + arch: arm64 + build_script: scripts/build-osx-arm.sh + osnick: monterey + + stop-osxarm-runner: + name: Stop self-hosted EC2 runner + needs: + - start-osxarm-runner + - macos-arm64 + runs-on: ubuntu-latest + if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION_ID }} + - name: Stop EC2 runner + uses: machulav/ec2-github-runner@v2 + with: + mode: stop + github-token: ${{ secrets.GH_ACCESS_TOKEN }} + label: ${{ needs.start-osxarm-runner.outputs.label }} + ec2-instance-id: ${{ needs.start-osxarm-runner.outputs.ec2-instance-id }} + + macos-x86_64: + uses: ./.github/workflows/REUSABLE-osx.yml + secrets: inherit + with: + macos_type: macos-latest + deps: brew install openssl@3 coreutils + arch: arm64 + build_script: scripts/build-osx.sh + osnick: monterey \ No newline at end of file