forked from rubygems/rubygems.org
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'rubygems:master' into master
- Loading branch information
Showing
1,344 changed files
with
63,873 additions
and
10,715 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: "2" | ||
exclude_patterns: | ||
- "config/" | ||
- "db/" | ||
- "dist/" | ||
- "features/" | ||
- "**/node_modules/" | ||
- "script/" | ||
- "**/spec/" | ||
- "**/test/" | ||
- "**/tests/" | ||
- "**/vendor/" | ||
- "**/*.d.ts" | ||
- "app/models/user.rb" | ||
method-count: | ||
config: | ||
threshold: 25 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# syntax = docker/dockerfile:1.4 | ||
|
||
ARG RUBY_VERSION=3.3.5 | ||
FROM ghcr.io/rails/devcontainer/images/ruby:$RUBY_VERSION | ||
|
||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get -y install --no-install-recommends pkg-config \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
{ | ||
"name": "RubyGems.org", | ||
"dockerComposeFile": [ | ||
"docker-compose.yml", | ||
"../docker-compose.yml" | ||
], | ||
"service": "rails-app", | ||
"runServices": [ | ||
"db", | ||
"cache", | ||
"search", | ||
"toxiproxy", | ||
"selenium" | ||
], | ||
"forwardPorts": [ | ||
3000, // Rails | ||
11211, // Memcache | ||
9200, // Opensearch | ||
5432 // PostgreSQL | ||
], | ||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"onCreateCommand": "bin/setup", | ||
// Use 'updateContentCommand' to run commands when the container is updated. | ||
"updateContentCommand": "bin/setup", | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
"features": { | ||
"ghcr.io/devcontainers/features/github-cli:1": {}, | ||
// "ghcr.io/rails/devcontainer/features/activestorage": {}, | ||
"ghcr.io/rails/devcontainer/features/postgres-client": {} | ||
}, | ||
// Configure tool-specific properties. | ||
"containerEnv": { | ||
"EDITOR": "code --wait", | ||
"GIT_EDITOR": "code --wait", | ||
"CAPYBARA_SERVER_PORT": "45678", | ||
"SELENIUM_HOST": "selenium", | ||
"ELASTICSEARCH_URL": "http://search:9200", | ||
"DATABASE_URL": "postgres://postgres@db:5432" | ||
}, | ||
"customizations": { | ||
"codespaces": { | ||
"openFiles": [ | ||
"README.md", | ||
"CONTRIBUTING.md" | ||
] | ||
}, | ||
"vscode": { | ||
"extensions": [ | ||
"Shopify.ruby-lsp" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
services: | ||
rails-app: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
command: sleep infinity | ||
volumes: | ||
- ../..:/workspaces:cached | ||
depends_on: | ||
- search | ||
- db | ||
- selenium | ||
|
||
selenium: | ||
image: selenium/standalone-chromium | ||
restart: unless-stopped |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,58 @@ | ||
# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files. | ||
|
||
# Ignore git directory. | ||
/.git/ | ||
|
||
# Ignore bundler config. | ||
/.bundle | ||
|
||
# Ignore all default key files. | ||
/config/master.key | ||
/config/credentials/*.key | ||
|
||
# Ignore all environment files. | ||
/.env* | ||
!/.env.example | ||
|
||
# Ignore all logfiles and tempfiles. | ||
/log/* | ||
/tmp/* | ||
/reports/* | ||
|
||
# Ignore storage (uploaded files in development and any SQLite databases). | ||
/storage/* | ||
|
||
# Ignore assets. | ||
/node_modules/ | ||
/app/assets/builds/* | ||
!/app/assets/builds/.keep | ||
/public/assets | ||
|
||
# Ignore tests | ||
/test/ | ||
|
||
# Ignore files that are generated by the build process. | ||
# /config/database.yml.sample | ||
/config/versions.list | ||
/vendor/toxic_domains_whole.txt | ||
|
||
# From before | ||
.git* | ||
.github* | ||
log/* | ||
tmp/* | ||
doc/* | ||
server/* | ||
vendor/cache/* | ||
config/deploy/* | ||
Dockerfile | ||
script/build_docker.sh | ||
.gitignore | ||
.gitmodules | ||
.travis.yml | ||
CONDUCT.md | ||
CONTRIBUTING.md | ||
MIT-LICENSE | ||
README.md | ||
shipit.yml | ||
coverage/ | ||
REVISION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
fonts: | ||
normal: "Arial" | ||
bold: "Arial Bold" | ||
italic: "Arial Italic" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
custom: [rubytogether.org, rubycentral.org] | ||
custom: https://rubycentral.org/#/portal/signup | ||
github: rubytogether |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: "Setup rubygems.org" | ||
description: "Setup steps for rubygems.org" | ||
inputs: | ||
ruby-version: | ||
description: "Ruby version to use" | ||
required: true | ||
rubygems-version: | ||
description: "RubyGems version to use" | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install and start services | ||
shell: bash | ||
run: | | ||
docker compose up -d --wait | ||
- uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # v1.191.0 | ||
with: | ||
ruby-version: ${{ inputs.ruby-version }} | ||
bundler-cache: true | ||
rubygems: ${{ inputs.rubygems-version }} | ||
- name: Print bundle environment | ||
shell: bash | ||
run: bundle env | ||
- name: Prepare environment | ||
shell: bash | ||
run: | | ||
cp config/database.yml.sample config/database.yml | ||
bundle exec rake db:setup assets:precompile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
codecov: | ||
notify: | ||
after_n_builds: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# For most projects, this workflow file will not need changing; you simply need | ||
# to commit it to your repository. | ||
# | ||
# You may wish to alter this file to override the set of languages analyzed, | ||
# or to provide custom queries or build logic. | ||
# | ||
# ******** NOTE ******** | ||
# We have attempted to detect the languages in your repository. Please check | ||
# the `language` matrix defined below to confirm you have the correct set of | ||
# supported CodeQL languages. | ||
# | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: ["master"] | ||
schedule: | ||
- cron: "0 0 * * 1" | ||
|
||
permissions: # added using https://github.com/step-security/secure-workflows | ||
contents: read | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-24.04 | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: ["javascript", "ruby"] | ||
# CodeQL supports [ $supported-codeql-languages ] | ||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
|
||
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs | ||
# queries: security-extended,security-and-quality | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun | ||
|
||
# If the Autobuild fails above, remove it and uncomment the following three lines. | ||
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. | ||
|
||
# - run: | | ||
# echo "Run, Build Application using script" | ||
# ./location_of_script_within_repo/buildscript.sh | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12 | ||
with: | ||
category: "/language:${{matrix.language}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Docker | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- oidc-api-tokens | ||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
build: | ||
name: Docker build (and optional push) | ||
runs-on: ubuntu-24.04 | ||
env: | ||
RUBYGEMS_VERSION: "3.5.20" | ||
RUBY_VERSION: "3.3.5" | ||
steps: | ||
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # master | ||
- name: Cache Docker layers | ||
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-rubygems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-rubygems-org | ||
- name: Install and start services (needed for image test) | ||
run: docker compose up -d | ||
- name: Configure AWS credentials from Production account | ||
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 | ||
if: github.secret_source != 'None' | ||
with: | ||
role-to-assume: arn:aws:iam::048268392960:role/rubygems-ecr-pusher | ||
aws-region: us-west-2 | ||
- name: Login to Amazon ECR | ||
if: github.secret_source != 'None' | ||
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1 | ||
- name: build, test and optionally push docker image | ||
run: ./script/build_docker.sh | ||
# Temp fix | ||
# https://github.com/docker/build-push-action/issues/252 | ||
# https://github.com/moby/buildkit/issues/1896 | ||
- name: Move cache | ||
run: | | ||
rm -rf /tmp/.buildx-cache | ||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache |
Oops, something went wrong.