I have this simple GitHub actions workflow on my self hosted Github Actions runner, running on MacOS:
name: "My Tests"
on: [push, pull_request]
jobs:
test:
runs-on: my-worker
env:
RAILS_ENV: test
ImageOS: macos1015
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1 # Not needed with a .ruby-version file
bundler-cache: true
- name: Create secrets.yml
run: cp config/secrets.yml.sample config/secrets.yml
- name: Run tests
run: bundle exec rails db:prepare && bundle exec rspec
However, when I run it, it complains it cannot connect to 127.0.0.1:3128
I am guessing the worker creates a private network and isolates the environment from my current environment.
How do I expose my locally running service to the worker? - I understand the security implications but this is a small team and there is nothing sensitive on this port (MQTT server that just dumps the messages).
DOH! - I had to change runs-on to:
Now it's running correctly on my machine, happy days!