-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Services not working #173
Comments
I was having a similar problem, especially when i was trying to combine rails caching with postgresql and redis. In the end i created a seperate workflow file called ci-local.yml based off of the production Github Actions file i had created and manually defined the services by calling apt-get then service %service_name% start. Massive PITA but for localised testing this was the only way i could thoroughly test the functional parts of GitHub Actions where multiple parts are as yet unsupported. Not a fix, just a hacky workaround to get myself out of trouble! |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as duplicate.
This comment was marked as duplicate.
@jadhavmanoj workaround is to use docker-compose |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
Airflow needs the db to be intialised even if DAGS aren't actually run. This github actions workflow creates a postgres service container[1], and then runs initdb before running pytest. However, I can't use act to test this locally, because it doesn't support service containers[2]. [1]. https://docs.github.com/en/free-pro-team@latest/actions/guides/creating-postgresql-service-containers [2]. nektos/act#173
Airflow needs the db to be intialised even if DAGS aren't actually run. This github actions workflow creates a postgres service container[1], and then runs initdb before running pytest. However, I can't use act to test this locally, because it doesn't support service containers[2]. [1]. https://docs.github.com/en/free-pro-team@latest/actions/guides/creating-postgresql-service-containers [2]. nektos/act#173
Airflow needs the db to be intialised even if DAGS aren't actually run. This github actions workflow creates a postgres service container[1], and then runs initdb before running pytest. However, I can't use act to test this locally, because it doesn't support service containers[2]. [1]. https://docs.github.com/en/free-pro-team@latest/actions/guides/creating-postgresql-service-containers [2]. nektos/act#173
Airflow needs the db to be intialised even if DAGS aren't actually run. This github actions workflow creates a postgres service container[1], and then runs initdb before running pytest. However, I can't use act to test this locally, because it doesn't support service containers[2]. [1]. https://docs.github.com/en/free-pro-team@latest/actions/guides/creating-postgresql-service-containers [2]. nektos/act#173
Airflow needs the db to be intialised even if DAGS aren't actually run. This github actions workflow creates a postgres service container[1], and then runs initdb before running pytest. However, I can't use act to test this locally, because it doesn't support service containers[2]. [1]. https://docs.github.com/en/free-pro-team@latest/actions/guides/creating-postgresql-service-containers [2]. nektos/act#173
Airflow needs the db to be intialised even if DAGS aren't actually run. This github actions workflow creates a postgres service container[1], and then runs initdb before running pytest. However, I can't use act to test this locally, because it doesn't support service containers[2]. [1]. https://docs.github.com/en/free-pro-team@latest/actions/guides/creating-postgresql-service-containers [2]. nektos/act#173
Airflow needs the db to be intialised even if DAGS aren't actually run. This github actions workflow creates a postgres service container[1], and then runs initdb before running pytest. However, I can't use act to test this locally, because it doesn't support service containers[2]. [1]. https://docs.github.com/en/free-pro-team@latest/actions/guides/creating-postgresql-service-containers [2]. nektos/act#173
Airflow needs the db to be intialised even if DAGS aren't actually run. This github actions workflow creates a postgres service container[1], and then runs initdb before running pytest. However, I can't use act to test this locally, because it doesn't support service containers[2]. [1]. https://docs.github.com/en/free-pro-team@latest/actions/guides/creating-postgresql-service-containers [2]. nektos/act#173
Airflow needs the db to be intialised even if DAGS aren't actually run. This github actions workflow creates a postgres service container[1], and then runs initdb before running pytest. However, I can't use act to test this locally, because it doesn't support service containers[2]. [1]. https://docs.github.com/en/free-pro-team@latest/actions/guides/creating-postgresql-service-containers [2]. nektos/act#173
Airflow needs the db to be intialised even if DAGS aren't actually run. This github actions workflow creates a postgres service container[1], and then runs initdb before running pytest. However, I can't use act to test this locally, because it doesn't support service containers[2]. [1]. https://docs.github.com/en/free-pro-team@latest/actions/guides/creating-postgresql-service-containers [2]. nektos/act#173
Hello, any update on this? My code: jobs:
test:
runs-on: ubuntu-latest
services:
mongodb:
image: mongo:4.0
ports:
- 27017/tcp
# ...etc In the env section of my job I have: The error: Thank you! |
@thatdoogieguy Could you provide a snippet of the step you wrote tha install & start postgresql ? |
Edit: I thought this was a bug, but in fact support for @Systho A small reproduction is:
name: "Reproduction"
on:
push:
jobs:
repro:
name: Reproduction of failing Services interpolation
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12
env:
POSTGRES_USER: runner
POSTGRES_PASSWORD: mysecretdbpass
POSTGRES_DB: mydb
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Echo the Postgres service ID / Network / Ports
run: |
echo "id: ${{ job.services.postgres.id }}"
echo "network: ${{ job.services.postgres.network }}"
echo "ports: ${{ job.services.postgres.ports }}"
|
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment was marked as duplicate.
This comment was marked as duplicate.
Services were drafted in #638 but author stopped responding, it works but it also breaks easily thus it wasn't merged |
Notification for people subscribed to this thread, please see latest PR mentioned. |
I added the following steps to my workflow in order to get the actions for my Rails app running locally: # Install local deps if this action is being run locally
- name: Install local dependencies
if: ${{ env.ACT }}
run: |
npm i -g yarn
sudo apt-get update
sudo apt-get -yqq install libgconf-2-4 libatk1.0-0 libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 libgbm-dev libnss3-dev libxss-dev libasound2 libxshmfence-dev postgresql postgresql-contrib redis-server
- name: Boot local dependencies
if: ${{ env.ACT }}
run: |
sudo service postgresql start
sudo service redis-server start
- name: Configure local dependencies
if: ${{ env.ACT }}
run: |
sudo -u postgres psql -U postgres -d postgres -c "alter user postgres with password 'password';" |
It would be great if the readme mentioned that |
thanks for providing this workaround. but installing everything every time is quite annoying, is any way to make act connect host service? e.g make act connect PostgreSQL that runs in the host. |
You can probably use |
This comment was marked as duplicate.
This comment was marked as duplicate.
Yea it is annoying, but connecting to host will likely restrict you to only 1 runner. Probably makes more sense to have database as part of the image, but I'm still researching how that can be done, i.e. where are they pulling |
This comment was marked as off-topic.
This comment was marked as off-topic.
@catthehacker Are you aware of any active development efforts? Last I've seen is #775 and would love to help get it over the finish line |
This is finished in a fork https://gitea.com/gitea/act. There aren't any active development efforts for this in nektos/act. |
Hello! I have this workflow:
The
yarn test
command expects to find a mongodb service listening on 27017, but running act the command fails withMongooseServerSelectionError: getaddrinfo ENOTFOUND mongodb
. The same workflow succeeds on GitHub.I've also tried
-P ubuntu-latest=nektos/act-environments-ubuntu:18.04
, any help is very appreciated :)The text was updated successfully, but these errors were encountered: