-
-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update workflows based on graphql-voyager's
- Loading branch information
1 parent
7d01eb6
commit 9f0e428
Showing
6 changed files
with
154 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,138 @@ | ||
name: CI | ||
on: [push, pull_request] | ||
on: workflow_call | ||
permissions: {} | ||
jobs: | ||
lint: | ||
name: Lint source files | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read # for actions/checkout | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v1 | ||
|
||
- name: Cache Node.js modules | ||
uses: actions/cache@v2 | ||
uses: actions/setup-node@v3 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.OS }}-node- | ||
cache: npm | ||
node-version-file: '.node-version' | ||
|
||
- name: Install Dependencies | ||
run: npm ci | ||
run: npm ci --ignore-scripts | ||
|
||
- name: Lint ESLint | ||
run: npm run lint | ||
|
||
- name: Check Types | ||
run: npm run check | ||
|
||
- name: Lint Prettier | ||
run: npm run prettier:check | ||
|
||
- name: Build package | ||
run: npm run build:all | ||
shell: bash | ||
- name: Spellcheck | ||
run: npm run check:spelling | ||
|
||
- name: Lint GitHub Actions | ||
uses: docker://rhysd/actionlint:latest | ||
with: | ||
args: -color | ||
|
||
checkForCommonlyIgnoredFiles: | ||
name: Check for commonly ignored files | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read # for actions/checkout | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Check if commit contains files that should be ignored | ||
run: | | ||
git clone --depth 1 https://github.com/github/gitignore.git | ||
rm gitignore/Global/ModelSim.gitignore | ||
rm gitignore/Global/Images.gitignore | ||
rm gitignore/Global/VirtualEnv.gitignore | ||
cat gitignore/Node.gitignore gitignore/Global/*.gitignore > all.gitignore | ||
IGNORED_FILES=$(git ls-files --cached --ignored --exclude-from=all.gitignore) | ||
if [[ "$IGNORED_FILES" != "" ]]; then | ||
echo -e "::error::Please remove these files:\n$IGNORED_FILES" | sed -z 's/\n/%0A/g' | ||
exit 1 | ||
fi | ||
checkPackageLock: | ||
name: Check health of package-lock.json file | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read # for actions/checkout | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: npm | ||
node-version-file: '.node-version' | ||
|
||
- name: Install Dependencies | ||
run: npm ci --ignore-scripts | ||
|
||
- name: Check that package-lock.json doesn't have conflicts | ||
run: npm ls --depth 999 | ||
|
||
- name: Run npm install | ||
run: npm install --ignore-scripts --force --package-lock-only --engine-strict --strict-peer-deps | ||
|
||
- name: Check that package-lock.json is in sync with package.json | ||
run: git diff --exit-code package-lock.json | ||
|
||
codeql: | ||
name: Run CodeQL security scan | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read # for actions/checkout | ||
security-events: write # for codeql-action | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: 'javascript, typescript' | ||
|
||
- name: Perform CodeQL analysis | ||
uses: github/codeql-action/analyze@v2 | ||
|
||
buildRelease: | ||
name: Build release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read # for actions/checkout | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: npm | ||
node-version-file: '.node-version' | ||
|
||
- name: Install Dependencies | ||
run: npm ci --ignore-scripts | ||
|
||
- name: Build release | ||
run: npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: PullRequest | ||
on: pull_request | ||
permissions: {} | ||
jobs: | ||
ci: | ||
permissions: | ||
contents: read # for actions/checkout | ||
security-events: write # for codeql-action | ||
uses: ./.github/workflows/ci.yml | ||
|
||
dependency-review: | ||
name: Security check of added dependencies | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read # for actions/checkout | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Dependency review | ||
uses: actions/dependency-review-action@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: Push | ||
on: push | ||
permissions: {} | ||
jobs: | ||
ci: | ||
permissions: | ||
contents: read # for actions/checkout | ||
security-events: write # for codeql-action | ||
uses: ./.github/workflows/ci.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters