Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
tbantle22 committed Nov 9, 2023
1 parent 609f597 commit 15da6f3
Show file tree
Hide file tree
Showing 9 changed files with 223 additions and 36 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/graphql-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Run graphql CI
on:
pull_request:
paths:
- 'graphql-server/**'
workflow_dispatch:

concurrency:
group: ci-graphql-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
ci:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install and run graphql CI
working-directory: ./graphql-server
run: |
yarn
yarn run ci
9 changes: 6 additions & 3 deletions .github/workflows/ci.yaml → .github/workflows/web-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Run CI
name: Run web CI
on:
pull_request:
paths:
- 'web/**'
workflow_dispatch:

concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
group: ci-web-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
Expand All @@ -16,7 +18,8 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install and run CI
- name: Install and run web CI
working-directory: ./web
run: |
yarn
yarn run ci
13 changes: 0 additions & 13 deletions check-status.sh

This file was deleted.

4 changes: 2 additions & 2 deletions graphql-server/check-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ async function checkServer(waitTime = 25000) {
// generateTypes runs the generate graphql types command in the web package
function generateTypes() {
return spawnSync("yarn", ["run", "generate-types"], {
cwd: `${__dirname}/web`,
cwd: `${__dirname}/../web`,
stdio: "inherit",
});
}

// runServer runs the graphql server and exits with error if the
// server writes to stderr or recieves an error event
// server writes to stderr or receives an error event
function runServer() {
const server = spawn("node", ["dist/main.js"], {
shell: true,
Expand Down
21 changes: 11 additions & 10 deletions graphql-server/ci-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,12 @@
set -e

if [ -z "$1" ]; then
echo "Must supply graphql-server package dir: ./ci-helper.sh ./packages/graphql-server"
echo "Must supply graphql-server package dir: ./ci-helper.sh ./graphql-server"
exit 1
fi

# compile web
(
cd "$1"/../web
yarn run compile
)

# compile and build graphql
(
cd "$1"/../graphql-server
yarn run compile
yarn run build
)

Expand All @@ -25,4 +17,13 @@ fi
node "$1"/check-server.js
)

exit 0
# Check for uncommitted changes
out=$(git status --porcelain)

if [ -z "$out" ]; then
exit 0
fi

echo "Found uncommitted changes during CI"
echo $out
exit 1
1 change: 1 addition & 0 deletions graphql-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"author": "DoltHub",
"private": true,
"scripts": {
"ci": "yarn prettier && yarn compile && yarn lint && yarn test && yarn build && yarn check",
"build": "nest build",
"check-server": "./ci-helper.sh ./",
"compile": "tsc -b",
Expand Down
175 changes: 175 additions & 0 deletions web/gen/graphql-types.tsx

Large diffs are not rendered by default.

10 changes: 2 additions & 8 deletions web/next.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
eslint: {
// Warning: This allows production builds to successfully complete even if
// your project has ESLint errors.
ignoreDuringBuilds: true,
},
}
const nextConfig = {};

module.exports = nextConfig
module.exports = nextConfig;
1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"author": "DoltHub",
"private": true,
"scripts": {
"ci": "yarn prettier && yarn compile && yarn lint && yarn test && yarn build",
"compile": "tsc -b",
"dev": "next dev -p 3002",
"build": "next build",
Expand Down

0 comments on commit 15da6f3

Please sign in to comment.