|
| 1 | +--- |
| 2 | +name: "PID Controller Automated Test" |
| 3 | + |
| 4 | +# yamllint disable-line rule:truthy |
| 5 | +on: |
| 6 | + pull_request: |
| 7 | + types: [opened, reopened, synchronize] |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: write |
| 11 | + pull-requests: write |
| 12 | + |
| 13 | +jobs: |
| 14 | + pid-controller-automated-test: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - name: Install dependencies |
| 18 | + run: | |
| 19 | + sudo apt-get update && sudo apt-get install -y build-essential libssl-dev libmysqlclient-dev imagemagick libmagickwand-dev |
| 20 | + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 21 | + with: |
| 22 | + ref: ${{ github.event.pull_request.head.sha }} |
| 23 | + fetch-depth: 0 |
| 24 | + - uses: ruby/setup-ruby@0481980f17b760ef6bca5e8c55809102a0af1e5a # v1.263.0 |
| 25 | + with: |
| 26 | + bundler-cache: true |
| 27 | + |
| 28 | + - name: Update Graphs |
| 29 | + run: | |
| 30 | + bundle install |
| 31 | + bundle exec rake compile |
| 32 | + cd experiments |
| 33 | + bundle install |
| 34 | + # Improve the experiment data collection and graphing |
| 35 | + sed -i 's/sleep(0.1)/sleep(0.005)/' example_with_circuit_breaker.rb |
| 36 | + # Make graph larger and more visible |
| 37 | + sed -i 's/Gruff::Line.new/Gruff::Line.new(1200)/' example_with_circuit_breaker.rb |
| 38 | + sed -i 's/graph.line_width = 3/graph.line_width = 5/' example_with_circuit_breaker.rb |
| 39 | + # Add debugging |
| 40 | + sed -i 's/puts "Generating graph/puts "DEBUG: Total data points:"; puts outcomes.size; puts "Sample data:"; puts outcomes.first(3).inspect; puts "Generating graph/' example_with_circuit_breaker.rb |
| 41 | + bundle exec ruby example_with_circuit_breaker.rb |
| 42 | + echo "=== Generated files ===" |
| 43 | + ls -la *.png |
| 44 | + echo "=== File contents check ===" |
| 45 | + file *.png |
| 46 | +
|
| 47 | + - name: Commit Graphs |
| 48 | + run: | |
| 49 | + git checkout ${{ github.head_ref }} |
| 50 | + git config user.name shopify-actions |
| 51 | + git config user.email [email protected] |
| 52 | + git add experiments/*.png |
| 53 | + if git diff --staged --quiet; then |
| 54 | + echo "No changes to commit" |
| 55 | + else |
| 56 | + git commit -m "Update experiment graphs" |
| 57 | + git push |
| 58 | + fi |
| 59 | +
|
0 commit comments