Skip to content

Commit

Permalink
Merge pull request #309 from DTS-STN/develop
Browse files Browse the repository at this point in the history
Release 2022-06-27
  • Loading branch information
JeremyKennedy authored Jun 27, 2022
2 parents fb07408 + e107572 commit a98284c
Show file tree
Hide file tree
Showing 96 changed files with 3,025 additions and 1,804 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "next"
"extends": ["next", "plugin:prettier/recommended"]
}
17 changes: 10 additions & 7 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ name: 'CodeQL'

on:
push:
branches: [main]
branches:
- main
- develop
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
branches:
- main
- develop
schedule:
- cron: '35 3 * * 6'

Expand All @@ -38,11 +41,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -53,7 +56,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -67,4 +70,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
83 changes: 50 additions & 33 deletions .github/workflows/run-scrapers.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,63 @@
name: Run scrapers
name: Legal values auto-update
on:
workflow_dispatch:
workflow_dispatch: # so we can run manually
schedule:
- cron: '0 0 * * *'
jobs:
build:
legal-values-auto-update:
runs-on: ubuntu-latest
steps:
- id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_KEY_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
git_committer_name: DTS-STN
git_committer_email: [email protected]
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v3

## Signing with GPG won't work unless we create a "DTS Bot" GitHub account.
#- name: Setup GPG key
# id: import_gpg
# uses: crazy-max/ghaction-import-gpg@v5
# with:
# gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
# passphrase: ${{ secrets.GPG_KEY_PASSPHRASE }}
# git_user_signingkey: true
# git_commit_gpgsign: true
# git_committer_name: GitHub Actions
# git_committer_email: [email protected]

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
- run: corepack enable
- run: yarn install
# - run: git checkout -b legal-values-autoupdate
- run: yarn run run-scraper
# - run: echo test > utils/api/scrapers/output/test.json
# - uses: EndBug/add-and-commit@v9
# with:
# add: 'utils/api/scrapers/output/*.json'
# new_branch: legal-values-autoupdate
# committer_name: DTS-STN
# committer_email: [email protected]
# - run: |
# git add 'utils/api/scrapers/output/*.json'
# git commit -S -m "update legal values"
# - run: git push -v --set-upstream origin legal-values-autoupdate
- uses: peter-evans/create-pull-request@v4
cache: 'yarn' # cache seems to not work until yarn is installed, so this might be futile

- name: Install Yarn
run: corepack enable

- name: Install dependencies
run: yarn install

- name: Run scraper
run: yarn run run-scraper

- name: Create pull request
uses: peter-evans/create-pull-request@v4
with:
commit-message: auto-update legal values
title: Auto-update legal values
body: This is created by a bot, please review.
branch: legal-values-autoupdate
body: |
This is created by a bot, please review and make any appropriate changes.
You will have to sign the bot's commit before merging, because it doesn't have permission to do so itself.
To do this, run the following commands:
```
git fetch
git switch legal-values-auto-update
git pull
git rebase --exec 'git commit -S --amend --no-edit' develop
git push --force
```
branch: legal-values-auto-update
base: develop
add-paths: |
utils/api/scrapers/output/*.json
committer: GitHub Actions <[email protected]>
author: GitHub Actions <[email protected]>
17 changes: 7 additions & 10 deletions .github/workflows/test-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
name: Lint and Test

on:
push:
branches:
- main
pull_request:
branches:
- main
Expand All @@ -16,25 +13,25 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout 🔔
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16.x
cache: yarn

- name: Install
run: yarn install --frozen-lockfile
run: yarn install --immutable

- name: Build
run: yarn run build

- name: Linting
- name: Lint
run: yarn run lint

- name: Run Unit Tests and Coverage 🧪
- name: Run Unit Tests and Coverage
run: yarn run test:ci

# - name: Extract branch name
Expand Down
94 changes: 85 additions & 9 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ node_modules/
coverage/
helmfile/
helm/
out/
yarn.lock
.pnp.cjs
.pnp.loader.mjs
7 changes: 6 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"recommendations": ["orta.vscode-jest"]
"recommendations": [
"orta.vscode-jest",
"arcanis.vscode-zipfs",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
10 changes: 9 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
{
"jest.jestCommandLine": "yarn test:coverage"
"jest.jestCommandLine": "yarn test:coverage",
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"eslint.nodePath": ".yarn/sdks",
"prettier.prettierPath": ".yarn/sdks/prettier/index.js",
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .yarn/cache/fsevents-patch-3340e2eb10-8.zip
Binary file not shown.
Binary file not shown.
Loading

1 comment on commit a98284c

@vercel
Copy link

@vercel vercel bot commented on a98284c Jun 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.