Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metamist release #554

Merged
merged 15 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
run:
shell: bash -eo pipefail -l {0}
steps:
- uses: actions/checkout@main
- uses: actions/checkout@v3

- name: "gcloud setup"
uses: google-github-actions/setup-gcloud@v0
uses: google-github-actions/setup-gcloud@v1
with:
project_id: sample-metadata
service_account_key: ${{ secrets.GCP_SERVER_DEPLOY_KEY }}
Expand All @@ -33,11 +33,11 @@ jobs:
run: |
gcloud auth configure-docker australia-southeast1-docker.pkg.dev

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: "3.10"

- uses: actions/setup-java@v2
- uses: actions/setup-java@v3
with:
distribution: "temurin" # See 'Supported distributions' for available options
java-version: "17"
Expand Down
40 changes: 35 additions & 5 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,52 @@ on: push
jobs:
lint:
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
BUILDKIT_PROGRESS: plain
CLOUDSDK_CORE_DISABLE_PROMPTS: 1
# used for generating API
SM_DOCKER: samplemetadata:dev
defaults:
run:
shell: bash -eo pipefail -l {0}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"

- name: Install packages
- uses: actions/setup-java@v2
with:
distribution: "temurin" # See 'Supported distributions' for available options
java-version: "17"

- name: Setup build env
run: |
set -euxo pipefail

pip install -r requirements-dev.txt
pip install -r requirements.txt

# openapi-generator
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar -O openapi-generator-cli.jar

- name: "build image"
run: |
docker build \
--build-arg SM_ENVIRONMENT=local \
--tag $SM_DOCKER \
-f deploy/api/Dockerfile \
.

- name: Build + install packages
run: |
export OPENAPI_COMMAND="java -jar openapi-generator-cli.jar"
python regenerate_api.py
pip install -r requirements-dev.txt
pip install .
mkdir .mypy_cache

- name: pre-commit
run: pre-commit run --all-files
12 changes: 6 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
run:
shell: bash -eo pipefail -l {0}
steps:
- uses: actions/checkout@main
- uses: actions/checkout@v3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: "3.10"

- uses: actions/setup-java@v2
- uses: actions/setup-java@v3
with:
distribution: "temurin" # See 'Supported distributions' for available options
java-version: "17"
Expand Down Expand Up @@ -70,10 +70,10 @@ jobs:
rc=$?
coverage xml

echo "::set-output name=rc::$rc"
echo "rc=$rc" >> $GITHUB_OUTPUT

- name: "Upload coverage report"
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml

Expand All @@ -89,7 +89,7 @@ jobs:

- name: Fail if tests are not passing
if: ${{ steps.runtests.outputs.rc != 0 }}
uses: actions/github-script@v3
uses: actions/github-script@v6
with:
script: |
core.setFailed('Unit tests failed with rc = ${{ steps.runtests.outputs.rc }}')
174 changes: 90 additions & 84 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,92 +1,98 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
exclude: '\.*conda/.*'
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: '\.txt$|\.tsv$'
- id: check-case-conflict
- id: check-merge-conflict
- id: detect-private-key
- id: debug-statements
- id: check-added-large-files
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
exclude: '\.*conda/.*'
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: '\.txt$|\.tsv$'
- id: check-case-conflict
- id: check-merge-conflict
- id: detect-private-key
- id: debug-statements
- id: check-added-large-files

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.33.0
hooks:
- id: markdownlint
args: ["--config", ".markdownlint.json"]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.33.0
hooks:
- id: markdownlint
args: ["--config", ".markdownlint.json"]

- repo: https://github.com/ambv/black
rev: 23.3.0
hooks:
- id: black
args: [.]
pass_filenames: false
always_run: true
exclude: ^metamist/
- repo: https://github.com/ambv/black
rev: 23.3.0
hooks:
- id: black
args: [.]
pass_filenames: false
always_run: true
exclude: ^metamist/

- repo: https://github.com/PyCQA/flake8
rev: "6.0.0"
hooks:
- id: flake8
additional_dependencies: [flake8-bugbear, flake8-quotes]
- repo: https://github.com/PyCQA/flake8
rev: "6.0.0"
hooks:
- id: flake8
additional_dependencies: [flake8-bugbear, flake8-quotes]

# Using system installation of pylint to support checking python module imports
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
# Using system installation of pylint to support checking python module imports
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]

# mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.961
hooks:
- id: mypy
args:
[
--pretty,
--show-error-codes,
--no-strict-optional,
--ignore-missing-imports,
--install-types,
--non-interactive,
]
additional_dependencies:
- strawberry-graphql[fastapi]==0.138.1
# mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
hooks:
- id: mypy
args:
[
--pretty,
--show-error-codes,
--no-strict-optional,
--ignore-missing-imports,
--install-types,
--non-interactive,
--show-error-context,
--check-untyped-defs,
--explicit-package-bases,
--disable-error-code,
operator,
]
additional_dependencies:
- strawberry-graphql[fastapi]==0.206.0
- types-PyMySQL==1.1.0.1

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0-alpha.4"
hooks:
- id: prettier
# I'm not exactly sure why it changes behaviour, but
# calling `cd web`, then calling `ls src/**/*.tsx`
# returns different results to `cd web && ls src/**/*.tsx`
# so just include both patterns here
entry: bash -c 'cd web && prettier --write --ignore-unknown --check src/*.{ts,tsx,css} src/**/*.{ts,tsx,css}'
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0-alpha.4"
hooks:
- id: prettier
# I'm not exactly sure why it changes behaviour, but
# calling `cd web`, then calling `ls src/**/*.tsx`
# returns different results to `cd web && ls src/**/*.tsx`
# so just include both patterns here
entry: bash -c 'cd web && prettier --write --ignore-unknown --check src/*.{ts,tsx,css} src/**/*.{ts,tsx,css}'

- repo: https://github.com/pre-commit/mirrors-eslint
rev: "v8.33.0"
hooks:
- id: eslint
entry: bash -c 'cd web && eslint'
files: \.[jt]sx?$
types: [file]
additional_dependencies:
- eslint@^7.32.0
- eslint-config-airbnb@^19.0.4
- eslint-config-airbnb-base@^15.0.0
- eslint-config-airbnb-typescript@^17.0.0
- eslint-config-prettier@^8.6.0
- eslint-plugin-import@^2.26.0
- eslint-plugin-jsx-a11y@^6.6.1
- eslint-plugin-prettier@^4.2.1
- eslint-plugin-react@^7.31.11
- eslint-plugin-react-hooks@^4.6.0
- "@typescript-eslint/eslint-plugin@^5.48.0"
- "@typescript-eslint/parser@^5.48.0"
- repo: https://github.com/pre-commit/mirrors-eslint
rev: "v8.33.0"
hooks:
- id: eslint
entry: bash -c 'cd web && eslint'
files: \.[jt]sx?$
types: [file]
additional_dependencies:
- eslint@^7.32.0
- eslint-config-airbnb@^19.0.4
- eslint-config-airbnb-base@^15.0.0
- eslint-config-airbnb-typescript@^17.0.0
- eslint-config-prettier@^8.6.0
- eslint-plugin-import@^2.26.0
- eslint-plugin-jsx-a11y@^6.6.1
- eslint-plugin-prettier@^4.2.1
- eslint-plugin-react@^7.31.11
- eslint-plugin-react-hooks@^4.6.0
- "@typescript-eslint/eslint-plugin@^5.48.0"
- "@typescript-eslint/parser@^5.48.0"
Loading
Loading