Skip to content

Commit

Permalink
Merge pull request #186 from gjtorikian/release-v1
Browse files Browse the repository at this point in the history
Release v1
  • Loading branch information
gjtorikian authored Nov 3, 2022
2 parents 7d40c34 + f90a222 commit c870fc5
Show file tree
Hide file tree
Showing 147 changed files with 13,138 additions and 34,795 deletions.
5 changes: 5 additions & 0 deletions .cross_rubies
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
3.1.0:x86_64-linux
3.1.0:aarch64-linux
3.1.0:x86_64-darwin
3.1.0:arm64-darwin
3.1.0:x64-mingw-ucrt
14 changes: 11 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,27 @@ updates:
directory: "/"
schedule:
interval: daily
time: "11:00"
time: "09:00"
timezone: "Etc/UTC"
open-pull-requests-limit: 10

- package-ecosystem: bundler
directory: "/"
schedule:
interval: daily
time: "11:00"
time: "09:00"
timezone: "Etc/UTC"
open-pull-requests-limit: 10
allow:
- dependency-name: "*"
dependency-type: "production"
- dependency-name: "sorbet*"
dependency-type: "all"

- package-ecosystem: cargo
directory: "/"
schedule:
interval: daily
time: "11:00"
time: "09:00"
timezone: "Etc/UTC"
open-pull-requests-limit: 10
35 changes: 35 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: PR auto-{approve,merge}

on:
pull_request_target:

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
name: Dependabot
runs-on: ubuntu-latest

if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Fetch Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Approve Dependabot PR
if: ${{steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major'}}
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Merge Dependabot PR
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

147 changes: 147 additions & 0 deletions .github/workflows/cruby-build-and-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: Test cruby build and installation
concurrency:
group: "${{github.workflow}}-${{github.ref}}"
cancel-in-progress: true

on:
pull_request:

jobs:
cruby-package:
name: Compile native gem
runs-on: ubuntu-latest
strategy:
# fail-fast: false
matrix:
platform:
- x86_64-linux
- aarch64-linux

- x86_64-darwin
# github actions does not support this runner, which is why it's
# missing below
- arm64-darwin

- x64-mingw-ucrt

steps:
- uses: actions/checkout@v3

- uses: oxidize-rb/actions/setup-ruby-and-rust@main
with:
ruby-version: "3.1"
rubygems: latest
bundler-cache: false
cargo-cache: true
cargo-vendor: true

- uses: oxidize-rb/cross-gem-action@main
with:
platform: ${{ matrix.platform }}
env: |
RUBY_CC_VERSION=3.1.0
- name: "Test gem build"
run: |
./script/test-gem-build gems ${{matrix.platform}}
- uses: actions/upload-artifact@v3
with:
name: "cruby-${{matrix.platform}}-gem"
path: gems
retention-days: 1

cruby-x86_64-linux-install:
needs: ["cruby-package"]
strategy:
fail-fast: false
matrix:
ruby: ["3.1"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: ruby/setup-ruby@v1
with:
rubygems: latest
ruby-version: "${{matrix.ruby}}"

- uses: actions/download-artifact@v3
with:
name: cruby-x86_64-linux-gem
path: gems
- run: ./script/test-gem-install gems

cruby-aarch64-linux-install:
needs: ["cruby-package"]
strategy:
fail-fast: false
matrix:
ruby: ["3.1"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: ruby/setup-ruby@v1
with:
rubygems: latest
ruby-version: "${{matrix.ruby}}"

- uses: actions/download-artifact@v3
with:
name: cruby-aarch64-linux-gem
path: gems

- run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm -v "$(pwd):/commonmarker" -w /commonmarker \
--platform=linux/arm64/v8 \
ruby:${{matrix.ruby}} \
./script/test-gem-install gems
cruby-x86_64-darwin-install:
needs: ["cruby-package"]
strategy:
fail-fast: false
matrix:
ruby: ["3.1"]
runs-on: macos-latest
steps:
- uses: actions/checkout@v3

- uses: ruby/setup-ruby@v1
with:
rubygems: latest
ruby-version: "${{matrix.ruby}}"

- uses: actions/download-artifact@v3
with:
name: cruby-x86_64-darwin-gem
path: gems

- run: ./script/test-gem-install gems

# FIXME: does not seem to work
# cruby-x64-mingw-ucrt-install:
# needs: ["cruby-package"]
# strategy:
# fail-fast: false
# matrix:
# ruby: ["3.1"]
# runs-on: windows-latest
# steps:
# - uses: ruby/setup-ruby@v1

# with:
# ruby-version: "${{matrix.ruby}}"

# - uses: actions/download-artifact@v3
# with:
# name: cruby-x64-mingw-ucrt-gem
# path: gems

# - run: |
# gem update --system 3.3.22 --no-document
# gem install --verbose --no-document gems/*.gem
# gem list -d commonmarker
# bundle exec ruby -e 'require "commonmarker"; puts Commonmarker.to_html("Hello, _world_")'
91 changes: 91 additions & 0 deletions .github/workflows/generic-build-and-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Test generic build and installation
concurrency:
group: "${{github.workflow}}-${{github.ref}}"
cancel-in-progress: true

on:
pull_request:

jobs:
generic-package:
name: "generic-package"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: oxidize-rb/actions/setup-ruby-and-rust@main
with:
ruby-version: "3.1"
rubygems: latest
bundler-cache: false
cargo-cache: true
cargo-vendor: true

- uses: oxidize-rb/cross-gem-action@main
with:
platform: x86_64-linux
env: |
RUBY_CC_VERSION=3.1.0
- run: ./script/test-gem-build gems ruby

- uses: actions/upload-artifact@v3
with:
name: generic-gem
path: gems
retention-days: 1

generic-linux-install:
needs: ["generic-package"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: ruby/setup-ruby-pkgs@v1
with:
ruby-version: "3.1"

- uses: actions/download-artifact@v3
with:
name: generic-gem
path: gems
- run: ./script/test-gem-install gems

# FIXME: does not seem to work
# generic-darwin-install:
# needs: ["generic-package"]
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v3

# - uses: ruby/setup-ruby@v1
# with:
# ruby-version: "3.1"

# - uses: actions/download-artifact@v3
# with:
# name: generic-gem
# path: gems
# - run: ./script/test-gem-install gems

# FIXME: does not seem to work
# generic-windows-install-ucrt:
# needs: ["generic-package"]
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v3

# - uses: ruby/setup-ruby-pkgs@v1
# with:
# ruby-version: "3.1"

# - uses: actions/download-artifact@v3
# with:
# name: generic-gem
# path: gems
# - run: |
# gem update --system 3.3.22 --no-document
# gem install --verbose --no-document gems/*.gem
# gem list -d commonmarker
# bundle exec ruby -e 'require "commonmarker"; puts Commonmarker.to_html("Hello, _world_")'
26 changes: 20 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,33 @@ name: Linting

on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main

jobs:
test:
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
ruby-version: 3.1
rubygems: latest
bundler-cache: true # 'bundle install' and cache
- name: Rubocop
run: bundle exec rake rubocop

clippy_format:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Obtain Rust
run: rustup override set ${{ matrix.rust }}
- name: Check clippy
run: rustup component add clippy && cargo clippy
- name: Check formatting
run: rustup component add rustfmt && cargo fmt -- --check
Loading

0 comments on commit c870fc5

Please sign in to comment.