Skip to content

Commit

Permalink
TEST: Add GH workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lloeki committed Nov 18, 2022
1 parent 026a3a0 commit 12d7cb7
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/build-ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Build Ruby

on:
push:
branches:
- "**"

env:
REGISTRY: ghcr.io

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- engine: ruby
version: 2.1.10
dockerfile: Dockerfile-2.1.10
- engine: ruby
version: 2.2.10
dockerfile: Dockerfile-2.2.10
- engine: ruby
version: 2.3.8
dockerfile: Dockerfile-2.3.8
- engine: ruby
version: 2.4.10
dockerfile: Dockerfile-2.4.10
- engine: ruby
version: 2.5.9
dockerfile: Dockerfile-2.5.9
- engine: ruby
version: 2.6.7
dockerfile: Dockerfile-2.6.7
- engine: ruby
version: 2.7.3
dockerfile: Dockerfile-2.7.3
- engine: ruby
version: 3.0.3
dockerfile: Dockerfile-3.0.3
- engine: ruby
version: 3.1.1
dockerfile: Dockerfile-3.1.1
- engine: ruby
version: 3.2.0-preview2
dockerfile: Dockerfile-3.2.0-preview2
- engine: jruby
version: 9.2.18.0
dockerfile: Dockerfile-jruby-9.2-latest
- engine: jruby
version: 9.2.8.0
dockerfile: Dockerfile-jruby-9.2.8.0
- engine: jruby
version: 9.3.4.0
dockerfile: Dockerfile-jruby-9.3-latest
- engine: truffleruby
version: 22.3.0
dockerfile: Dockerfile-truffleruby-22.3.0
runs-on: ubuntu-latest
name: Build (${{ matrix.engine }} ${{ matrix.version }})
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build image (x86_64)
run: |
docker buildx build . --cache-from=type=gha --cache-to=type=gha,mode=max --platform linux/x86_64 -f ${{ matrix.dockerfile }} --tag ${{ env.REGISTRY }}/datadog/dd-trace-rb/${{ matrix.engine }}:${{ matrix.version }}-dd-trace-rb
working-directory: .circleci/images/primary
- name: Test image (x86_64)
run: |
docker run --platform linux/x86_64 --rm ${{ env.REGISTRY }}/datadog/dd-trace-rb/${{ matrix.engine }}:${{ matrix.version }}-dd-trace-rb ruby -e 'puts RUBY_DESCRIPTION'
docker run --platform linux/x86_64 --rm ${{ env.REGISTRY }}/datadog/dd-trace-rb/${{ matrix.engine }}:${{ matrix.version }}-dd-trace-rb gem --version
docker run --platform linux/x86_64 --rm ${{ env.REGISTRY }}/datadog/dd-trace-rb/${{ matrix.engine }}:${{ matrix.version }}-dd-trace-rb bundle --version
- name: Enable aarch64 emulation (x86_64)
run: |
docker run --privileged --rm tonistiigi/binfmt --install arm64
- name: Build image (aarch64)
run: |
docker buildx build . --cache-from=type=gha --cache-to=type=gha,mode=max --platform linux/aarch64 -f ${{ matrix.dockerfile }} --tag ${{ env.REGISTRY }}/datadog/dd-trace-rb/${{ matrix.engine }}:${{ matrix.version }}-dd-trace-rb
working-directory: .circleci/images/primary
- name: Test image (aarch64)
run: |
docker run --platform linux/aarch64 --rm ${{ env.REGISTRY }}/datadog/dd-trace-rb/${{ matrix.engine }}:${{ matrix.version }}-dd-trace-rb ruby -e 'puts RUBY_DESCRIPTION'
docker run --platform linux/aarch64 --rm ${{ env.REGISTRY }}/datadog/dd-trace-rb/${{ matrix.engine }}:${{ matrix.version }}-dd-trace-rb gem --version
docker run --platform linux/aarch64 --rm ${{ env.REGISTRY }}/datadog/dd-trace-rb/${{ matrix.engine }}:${{ matrix.version }}-dd-trace-rb bundle --version
- name: Log in to the Container Registry
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin

0 comments on commit 12d7cb7

Please sign in to comment.