Browse Source

Update node version and apply lint

pull/2379/head
Hironsan 1 month ago
parent
commit
8c7e5263b2
7 changed files with 68 additions and 70 deletions
  1. 12
      .github/workflows/ci.yml
  2. 68
      .github/workflows/codeql-analysis.yml
  3. 2
      .github/workflows/mkdocs-deployment.yml
  4. 4
      .github/workflows/publish-image.yml
  5. 8
      .github/workflows/pypi-publish.yml
  6. 40
      .github/workflows/test-installation.yml
  7. 4
      backend/config/settings/gcp.py

12
.github/workflows/ci.yml

@ -9,9 +9,9 @@ jobs:
run:
working-directory: ./backend
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
@ -45,10 +45,10 @@ jobs:
run:
working-directory: ./frontend
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "16"
node-version: '18'
- name: Install Yarn
run: npm install -g yarn
- name: Install npm modules
@ -65,6 +65,6 @@ jobs:
run:
working-directory: ./docker
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: hadolint
run: hadolint ./Dockerfile*

68
.github/workflows/codeql-analysis.yml

@ -3,7 +3,7 @@
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL"
name: 'CodeQL'
on:
push:
@ -29,43 +29,43 @@ jobs:
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
- name: Checkout repository
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# 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
# 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
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

2
.github/workflows/mkdocs-deployment.yml

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@1.16
env:

4
.github/workflows/publish-image.yml

@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Docker meta
id: docker_meta
@ -56,7 +56,7 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: doccano/doccano:backend
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Build a frontend image and push
uses: docker/build-push-action@v3
with:

8
.github/workflows/pypi-publish.yml

@ -9,16 +9,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Preparation
run: |
mkdir backend/client
- name: Fix up git URLs
run: echo -e '[url "https://github.com/"]\n insteadOf = "git@github.com:"' >> ~/.gitconfig
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: '18.x'
- name: Build with Node.js
run: |
yarn install
@ -28,7 +28,7 @@ jobs:
env:
PUBLIC_PATH: '/static/_nuxt/'
- name: Setup Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies

40
.github/workflows/test-installation.yml

@ -2,7 +2,7 @@ name: Test installation and doccano commands
on:
schedule:
- cron: "15 22 * * *"
- cron: '15 22 * * *'
jobs:
test:
@ -10,23 +10,23 @@ jobs:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10"]
python-version: ['3.8', '3.9', '3.10']
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Enabling JSON1 extension on SQLite
if: ${{ startsWith(matrix.os, 'windows') && matrix.python-version == '3.8' }}
shell: bash
run: |
export VERSION=`python -V | cut -f2 -d " "`
curl -LO https://www.sqlite.org/2022/sqlite-dll-win64-x64-3390300.zip
unzip sqlite-dll-win64-x64-3390300.zip
mv sqlite3.dll /c/hostedtoolcache/windows/Python/$VERSION/x64/DLLs/
- name: Test installation
run: pip install doccano
- name: Test doccano init command
run: doccano init
- name: Test doccano createuser command
run: doccano createuser --username admin --password pass
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Enabling JSON1 extension on SQLite
if: ${{ startsWith(matrix.os, 'windows') && matrix.python-version == '3.8' }}
shell: bash
run: |
export VERSION=`python -V | cut -f2 -d " "`
curl -LO https://www.sqlite.org/2022/sqlite-dll-win64-x64-3390300.zip
unzip sqlite-dll-win64-x64-3390300.zip
mv sqlite3.dll /c/hostedtoolcache/windows/Python/$VERSION/x64/DLLs/
- name: Test installation
run: pip install doccano
- name: Test doccano init command
run: doccano init
- name: Test doccano createuser command
run: doccano createuser --username admin --password pass

4
backend/config/settings/gcp.py

@ -13,6 +13,4 @@ GS_PROJECT_ID = env("GS_PROJECT_ID")
# https://django-storages.readthedocs.io/en/latest/backends/gcloud.html#authentication-settings
_google_application_credentials = env("GOOGLE_APPLICATION_CREDENTIALS", "")
if _google_application_credentials:
GS_CREDENTIALS = service_account.Credentials.from_service_account_file(
_google_application_credentials
)
GS_CREDENTIALS = service_account.Credentials.from_service_account_file(_google_application_credentials)
Loading…
Cancel
Save