Skip to content

Commit 0e0a7d8

Browse files
committed
Copied from another repo
1 parent be7da47 commit 0e0a7d8

File tree

8 files changed

+122
-2
lines changed

8 files changed

+122
-2
lines changed

.github/workflows/nodejs.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Node CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-16.04
9+
10+
strategy:
11+
matrix:
12+
node-version: [12.x]
13+
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Install Hasura cli
17+
run: curl -L https://github.com/hasura/graphql-engine/raw/master/cli/get.sh | bash
18+
- name: Start up the Docker containers and migrate to the latest version of the database
19+
run: |
20+
docker-compose up -d
21+
sleep 4
22+
cd docker
23+
echo $(docker ps)
24+
hasura migrate status --skip-update-check --endpoint http://localhost:8080
25+
- name: Use Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@v1
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
- name: npm install, build, and test
30+
run: |
31+
node index.js
32+
env:
33+
CI: true

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 joshuarobs
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# test-ci
2-
Testing Hasura and PostgreSQL with GitHub Actions
1+
# making-hasura-work-with-github-actions
2+
Making Hasura work with GitHub Actions

docker-compose.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: '3.6'
2+
services:
3+
postgres:
4+
image: postgres
5+
restart: always
6+
volumes:
7+
- db_data:/var/lib/postgresql/data
8+
graphql-engine:
9+
image: hasura/graphql-engine:v1.0.0
10+
ports:
11+
- "8080:8080"
12+
depends_on:
13+
- "postgres"
14+
restart: always
15+
environment:
16+
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:@postgres:5432/postgres
17+
HASURA_GRAPHQL_ENABLE_CONSOLE: "true" # set to "false" to disable console
18+
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
19+
## uncomment next line to set an admin secret
20+
# HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey
21+
volumes:
22+
db_data:

docker/config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
endpoint: http://localhost:8080

docker/migrations/docker-compose.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: '3.6'
2+
services:
3+
postgres:
4+
image: postgres
5+
restart: always
6+
volumes:
7+
- db_data:/var/lib/postgresql/data
8+
graphql-engine:
9+
image: hasura/graphql-engine:v1.0.0
10+
ports:
11+
- "8080:8080"
12+
depends_on:
13+
- "postgres"
14+
restart: always
15+
environment:
16+
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:@postgres:5432/postgres
17+
HASURA_GRAPHQL_ENABLE_CONSOLE: "false" # set to "false" to disable console
18+
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
19+
## uncomment next line to set an admin secret
20+
# HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey
21+
volumes:
22+
db_data:

index.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('Hello World');

package.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "making-hasura-work-with-github-actions",
3+
"version": "1.0.0",
4+
"description": "Making Hasura work with GitHub Actions",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/joshuarobs/making-hasura-work-with-github-actions.git"
12+
},
13+
"keywords": [],
14+
"author": "",
15+
"license": "MIT",
16+
"bugs": {
17+
"url": "https://github.com/joshuarobs/making-hasura-work-with-github-actions/issues"
18+
},
19+
"homepage": "https://github.com/joshuarobs/making-hasura-work-with-github-actions#readme"
20+
}

0 commit comments

Comments
 (0)