Skip to content

Commit

Permalink
Merge pull request #125 from FranGuam/dev
Browse files Browse the repository at this point in the history
Add share_course table
  • Loading branch information
xiangmy21 authored Nov 14, 2023
2 parents c8a33db + be8af89 commit a51a54c
Show file tree
Hide file tree
Showing 13 changed files with 170 additions and 65 deletions.
35 changes: 35 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
pull_request_rules:
- name: branch name check
conditions:
- "head~=^(master|main)/"
- "-merged"
- "-closed"
actions:
close:
message: |
@{{author}}
Wrong Branch Name: {{head}}
Please use a meaningful name instead.
This Pull Request will be closed.
label:
add:
- "invalid"
- name: delete head branch after merge
conditions:
- merged
actions:
delete_head_branch: {}
- name: automatic label Renovate pull requests
conditions:
- author=renovate[bot]
actions:
label:
add:
- "dependencies"
- name: automatic merge for Renovate pull requests
conditions:
- author=renovate[bot]
- check-success=test
actions:
merge:
method: rebase
10 changes: 10 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": ["config:base"],
"automerge": true,
"timezone": "Asia/Shanghai",
"schedule": "after 4am and before 8am every saturday",
"lockFileMaintenance": {
"enabled": true,
"schedule": "after 4pm on saturday"
}
}
79 changes: 79 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: actions

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Test Run
shell: bash
run: docker compose up -d

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"

- name: Get yarn cache path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{steps.yarn-cache-dir-path.outputs.dir}}
key: ${{runner.os}}-yarn-${{hashFiles('**/yarn.lock')}}
restore-keys: |
${{runner.os}}-yarn-
- name: Install dependencies
run: yarn

- name: Test apply
run: |
yarn hasura migrate apply --endpoint http://localhost:23333
yarn hasura metadata apply --endpoint http://localhost:23333
deploy:
if: |
github.event_name == 'push' &&
github.ref_name == 'master' &&
github.repository_owner == 'eesast'
needs: test
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"

- name: Get yarn cache path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{steps.yarn-cache-dir-path.outputs.dir}}
key: ${{runner.os}}-yarn-${{hashFiles('**/yarn.lock')}}
restore-keys: |
${{runner.os}}-yarn-
- name: Install dependencies
run: yarn

- name: Apply changes
run: |
yarn hasura migrate apply --endpoint ${{secrets.HASURA_GRAPHQL_ENDPOINT}} --admin-secret ${{secrets.HASURA_GRAPHQL_ADMIN_SECRET}}
yarn hasura metadata apply --endpoint ${{secrets.HASURA_GRAPHQL_ENDPOINT}} --admin-secret ${{secrets.HASURA_GRAPHQL_ADMIN_SECRET}}
37 changes: 0 additions & 37 deletions .github/workflows/deploy.yml

This file was deleted.

1 change: 1 addition & 0 deletions docker-compose.yaml → docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ services:
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
## uncomment next line to set an admin secret
# HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey
ACTION_SECRET: myactionsecretkey
17 changes: 17 additions & 0 deletions metadata/tables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3192,6 +3192,23 @@
- salutation
- type
filter: {}
- table:
name: share_course
schema: public
select_permissions:
- role: student
permission:
columns:
- year
- code
- fullname
- language
- name
- professor
- semester
- type
- uuid
filter: {}
- table:
name: tag
schema: public
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE "public"."share_course";
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE TABLE "public"."share_course" ("uuid" uuid NOT NULL DEFAULT gen_random_uuid(), "index" text NOT NULL, "fullname" text NOT NULL, "name" text NOT NULL, "year" integer NOT NULL DEFAULT 2000, "semester" text NOT NULL, "professor" text NOT NULL, "type" Text NOT NULL, "language" text NOT NULL DEFAULT '中文', PRIMARY KEY ("uuid") , UNIQUE ("uuid"));COMMENT ON TABLE "public"."share_course" IS E'所有电子系的课程,用于课程评测';
CREATE EXTENSION IF NOT EXISTS pgcrypto;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."share_course" rename column "code" to "index";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."share_course" rename column "index" to "code";
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "eesast-hasura",
"dependencies": {
"hasura-cli": "2.24.1"
"hasura-cli": "2.35.0"
},
"scripts": {
"apply": "hasura migrate apply && hasura metadata apply",
Expand Down
5 changes: 0 additions & 5 deletions renovate.json

This file was deleted.

44 changes: 22 additions & 22 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,65 +4,65 @@

ansi-styles@^3.2.1:
version "3.2.1"
resolved "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
integrity sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=
resolved "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
dependencies:
color-convert "^1.9.0"

axios@^0.21.1:
version "0.21.4"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575"
resolved "https://registry.npmmirror.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575"
integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==
dependencies:
follow-redirects "^1.14.0"

chalk@^2.4.2:
version "2.4.2"
resolved "https://registry.npm.taobao.org/chalk/download/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
integrity sha1-zUJUFnelQzPPVBpJEIwUMrRMlCQ=
resolved "https://registry.npmmirror.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
dependencies:
ansi-styles "^3.2.1"
escape-string-regexp "^1.0.5"
supports-color "^5.3.0"

color-convert@^1.9.0:
version "1.9.3"
resolved "https://registry.npm.taobao.org/color-convert/download/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
integrity sha1-u3GFBpDh8TZWfeYp0tVHHe2kweg=
resolved "https://registry.npmmirror.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==
dependencies:
color-name "1.1.3"

[email protected]:
version "1.1.3"
resolved "https://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
resolved "https://registry.npmmirror.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==

escape-string-regexp@^1.0.5:
version "1.0.5"
resolved "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz?cache=0&sync_timestamp=1587627107924&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fescape-string-regexp%2Fdownload%2Fescape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
resolved "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==

follow-redirects@^1.14.0:
version "1.15.1"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5"
integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==
version "1.15.3"
resolved "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a"
integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==

has-flag@^3.0.0:
version "3.0.0"
resolved "https://registry.npm.taobao.org/has-flag/download/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
resolved "https://registry.npmmirror.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==

hasura-cli@2.24.1:
version "2.24.1"
resolved "https://registry.yarnpkg.com/hasura-cli/-/hasura-cli-2.24.1.tgz#832fe34246a5fe85bde510888c8babc304f7d608"
integrity sha512-qLfjLisf/pe/1/ZVfjcAzndUg5ZKRgXU7eVRiXRVE74YxJFej43ebRsLtBuzJSpAE0Hg7TYw9DaCAjPaBahgQA==
hasura-cli@2.35.0:
version "2.35.0"
resolved "https://registry.npmmirror.com/hasura-cli/-/hasura-cli-2.35.0.tgz#d95dae977fe8d290a63cfe24a576105065c4504c"
integrity sha512-aK3+vR0q2UwUZVai/ojDSQolt7JWI6cxPo8t/Sx4oD4INYgX8u0WRw6W7DWvaPfnSm9yHGEFvfJJnp670Tc3rQ==
dependencies:
axios "^0.21.1"
chalk "^2.4.2"

supports-color@^5.3.0:
version "5.5.0"
resolved "https://registry.npm.taobao.org/supports-color/download/supports-color-5.5.0.tgz?cache=0&sync_timestamp=1598611732186&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
integrity sha1-4uaaRKyHcveKHsCzW2id9lMO/I8=
resolved "https://registry.npmmirror.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
dependencies:
has-flag "^3.0.0"

0 comments on commit a51a54c

Please sign in to comment.