Skip to content

Conversation

@knakatasf
Copy link
Contributor

@knakatasf knakatasf commented May 23, 2025

Description

(1) .github/workflows/build.yml: Replaced the hardcoded credentials with GitHub secrets environment variables.
(2) .github/workflows/build-docker.yml: This is a newly added workflow; it builds Docker images and run the container in the GitHub Actions virtual machine; conducts check and test.
(3) docker-compose.ci.yml: This is a new docker-compose file for docker composing up in the GitHub Actions virtual machine. It is the same as the original docker-compose.yml except the credentials.

Fixes #553

(1) The new build.yml file is basically the same as before except the credentials. Please add the following environment variables to GitHub secrets.

OED_DB_DATABASE = oed
OED_DB_HOST = postgres
OED_DB_PASSWORD = opened
OED_DB_PORT = 5432
OED_DB_TEST_DATABASE = oed_testing
OED_DB_USER = oed
OED_SERVER_PORT = 3000
OED_TEST_SITE_READING_RATE = 00:15:00
OED_TOKEN_SECRET = travis

Repo -> Settings -> Secrets and variables -> Actions
image

(2) The new build-docker.yml workflow was added so we can check and test the OED in the same environment as the developers do. This workflow builds Docker images, runs the containers, checks header, typescript, types and lint, and npm test.

(3) The newly added docker-compose.ci.yml is for docker composing up in GitHub Actions virtual machine. This is basically the same as the original docker-compose.yml except the credentials.

Type of change

  • Note merging this changes the database configuration.
  • This change requires a documentation update

Checklist

(Note what you have done by placing an "x" instead of the space in the [ ] so it becomes [x]. It is hoped you do all of them.)

  • I have followed the OED pull request ideas
  • I have removed text in ( ) from the issue request
  • You acknowledge that every person contributing to this work has signed the OED Contributing License Agreement and each author is listed in the Description section.

Limitations

(1) I think OED_DB_HOST doesn't need to be injected as an environment variable. OED_DB_HOST can be hardcoded as before. It should be identical with the name of the database. In build.yml, it is "postgres" and in build-docker.yml, it is "database," which are already defined in the respective yml file.
(2) Other environment variables in docker-compose.ci.yml should be also stored in GitHub secrets?
image

@huss
Copy link
Member

huss commented Jun 10, 2025

@knakatasf I'm sorry for the delay in getting to this. I've tried to get it to work but the test startup fails so I wanted to see if you have any advice. I set up the GitHub secrets as you documented but the tests seem not to see them with the error You must specify POSTGRES_PASSWORD to a non-empty value .... It seems the password is blank but I'm pretty sure I set the related secret. I did notice that the values differ from what was used before in build.yml. I thought maybe OED is reusing workflows but that does not see the case. Plus, the error implies the password is blank. Thus, I wanted to ask if it worked for you locally (if can test) or any other thoughts. Thanks.

@huss
Copy link
Member

huss commented Jul 21, 2025

@knakatasf I appreciate your work on this issue and saw your commit from about a month ago. Do you have any other information to share or any ideas? Thanks.

@huss
Copy link
Member

huss commented Sep 15, 2025

@knakatasf I wanted to touch base to see if you are going to be able to work on this any more. Knowing will help OED plan how to proceed. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

enhancement to GitHub Action testing for DB

2 participants