Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Earlopain committed Apr 25, 2024
1 parent f575343 commit 2c0855c
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: GitHub CI

on:
pull_request:
push:
# pull_request:
# push:
workflow_dispatch:
schedule:
- cron: 0 0 * * 0
# schedule:
# - cron: 0 0 * * 0

defaults:
run:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Docker Build

on:
workflow_dispatch:
schedule:
- cron: 0 20 * * *

permissions:
contents: read
packages: write

jobs:
generate-jobs:
name: Generate Jobs
runs-on: ubuntu-latest
outputs:
strategy: ${{ steps.generate-jobs.outputs.strategy }}
steps:
- uses: actions/checkout@v3
- uses: docker-library/bashbrew@HEAD
- id: generate-jobs
name: Generate Jobs
run: echo "variants=$(./variants.rb)" >> "$GITHUB_OUTPUT"

test:
needs: generate-jobs
runs-on: ubuntu-latest
strategy:
matrix:
variants: ${{ fromJson(needs.generate-jobs.outputs.variants) }}
name: ${{ matrix.variant }}
steps:
- run: echo ${{ matrix.variant }}
# - uses: actions/checkout@v3
# - name: Prepare Environment
# run: ${{ matrix.runs.prepare }}
# - name: Pull Dependencies
# run: ${{ matrix.runs.pull }}
# - name: Build ${{ matrix.name }}
# run: ${{ matrix.runs.build }}
# - name: History ${{ matrix.name }}
# run: ${{ matrix.runs.history }}
# - name: Test ${{ matrix.name }}
# run: ${{ matrix.runs.test }}
# - name: '"docker images"'
# run: ${{ matrix.runs.images }}
23 changes: 23 additions & 0 deletions switch-to-nightly.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env ruby

require "json"
require "net/http"

current_json = JSON.parse(File.read("versions.json"))
latest_release = current_json.keys.map(&:to_f).max.to_s
donor = current_json[latest_release]

uri = URI("https://cache.ruby-lang.org/pub/ruby/snapshot/snapshot-master.json")
res = Net::HTTP.get_response(uri)
raise StandardError, "Got status code #{res.code}: #{res.body}" unless res.code == "200"

master = JSON.parse(res.body).first
master["url"] = master["filename"].transform_values { |file| "https://cache.ruby-lang.org/pub/ruby/snapshot/#{file}" }
master.delete("filename")
master.merge!({
"version" => "master",
"variants" => donor["variants"],
"rust" => donor["rust"],
"rustup" => donor["rustup"],
})
File.write("versions.json", JSON.pretty_generate({ "master" => master }))
6 changes: 6 additions & 0 deletions variants.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env ruby

require "json"

json = JSON.parse(File.read("versions.json"))
puts json["master"]["variants"].to_json

0 comments on commit 2c0855c

Please sign in to comment.