Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bleeding edge workflow
Browse files Browse the repository at this point in the history
Earlopain committed Oct 21, 2024

Verified

This commit was signed with the committer’s verified signature.
1 parent df6816d commit 49395c2
Showing 3 changed files with 42 additions and 4 deletions.
11 changes: 11 additions & 0 deletions .github/bleeding_edge.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
puts "source \"https://rubygems.org\""

Gem::Specification.stubs.map do |stub|
url = stub.metadata["source_code_uri"] || stub.homepage
matched = url[%r{https?://git(?:hub|lab)\.com/[^\/]*/[^\/]*}]
if matched
puts "gem #{stub.name.inspect}, git: #{matched.inspect}"
else
puts "gem #{stub.name.inspect}"
end
end
30 changes: 28 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -7,10 +7,20 @@ on: # yamllint disable-line rule:truthy
pull_request:
branches:
- master
schedule:
- cron: 0 20 * * *
workflow_dispatch:
inputs:
bleeding_edge:
type: boolean
default: false

permissions:
contents: read

env:
BLEEDING_EDGE: "${{ (inputs.bleeding_edge == true || github.event_name == 'schedule') && 'true' || 'false' }}"

jobs:
tests:
runs-on: ubuntu-latest
@@ -19,6 +29,18 @@ jobs:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- if: env.BLEEDING_EDGE == 'true'
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- if: env.BLEEDING_EDGE == 'true'
name: Unfreeze bundler
run: bundle config --local deployment false
- if: env.BLEEDING_EDGE == 'true'
name: "Use git gem sources"
run: bundle exec ruby .github/bleeding_edge.rb > Gemfile && bundle lock && cat Gemfile.lock


- name: Build
uses: docker/build-push-action@v5
@@ -27,6 +49,8 @@ jobs:
cache-to: type=gha,mode=max
load: true
tags: foxtrove
build-args: |
BASE_IMAGE=${{ env.BLEEDING_EDGE == 'true' && 'ghcr.io/docker-ruby-nightly/ruby:alpine3.20-nightly' || ''}}
- name: Set env file
run: |
@@ -54,7 +78,8 @@ jobs:
with:
bundler-cache: true

- name: Run Rubocop
- if: env.BLEEDING_EDGE == 'false'
name: Run Rubocop
run: bundle exec rubocop --format github

docker-checks:
@@ -67,5 +92,6 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Run ${{ matrix.service }}
- if: env.BLEEDING_EDGE == 'false'
name: Run ${{ matrix.service }}
run: docker compose run ${{ matrix.service }}
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ruby:3.3.4-alpine3.20 AS ruby-builder
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-ruby:3.3.4-alpine3.20} AS ruby-builder

RUN apk --no-cache add build-base cmake postgresql16-dev

@@ -12,7 +13,7 @@ FROM node:20-alpine3.20 AS node-downloader

RUN npm install [email protected] -g

FROM ruby:3.3.4-alpine3.20
FROM ${BASE_IMAGE:-ruby:3.3.4-alpine3.20}

WORKDIR /app

0 comments on commit 49395c2

Please sign in to comment.