Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/google/magika
Browse files Browse the repository at this point in the history
  • Loading branch information
invernizzi committed Mar 25, 2024
2 parents f965fbd + 5da6443 commit a3ab159
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 11 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '42 13 * * 2'

permissions:
contents: read

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
# required for all workflows
security-events: write

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
language: [ 'c-cpp', 'javascript-typescript', 'python' ]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
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.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
with:
category: "/language:${{matrix.language}}"
3 changes: 3 additions & 0 deletions .github/workflows/js-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
tags:
- 'js-v[0-9]+.[0-9]+.[0-9]+'
permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/js-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ on:
paths:
- 'js/**'
- '.github/workflows/**'

permissions:
contents: read
jobs:
unit-testing:
strategy:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/python-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
- 'python/**'
- '.github/workflows/**'

permissions:
contents: read

jobs:
e2e-testing:
strategy:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/python-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on:
- 'tests_data/**'
- '.github/workflows/**'

permissions:
contents: read

jobs:
unit-testing:
strategy:
Expand Down
20 changes: 10 additions & 10 deletions docs/js.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,26 +206,26 @@ Returns **[Promise][21]\<ModelResult>** A dictionary containing the top label an

[18]: #parameters-7

[19]: https://github.com/google/magika/blob/af1baf4857bf39756ec7516bede78e6294c86cea/js/magika_node.ts#L29-L134 "Source code on GitHub"
[19]: https://github.com/google/magika/blob/0577a5b218db5dbfbf88f968ba9da701a397ec2f/js/magika_node.ts#L29-L134 "Source code on GitHub"

[20]: https://github.com/google/magika/blob/af1baf4857bf39756ec7516bede78e6294c86cea/js/magika_node.ts#L45-L58 "Source code on GitHub"
[20]: https://github.com/google/magika/blob/0577a5b218db5dbfbf88f968ba9da701a397ec2f/js/magika_node.ts#L45-L58 "Source code on GitHub"

[21]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise

[22]: https://github.com/google/magika/blob/af1baf4857bf39756ec7516bede78e6294c86cea/js/magika_node.ts#L66-L69 "Source code on GitHub"
[22]: https://github.com/google/magika/blob/0577a5b218db5dbfbf88f968ba9da701a397ec2f/js/magika_node.ts#L66-L69 "Source code on GitHub"

[23]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

[24]: https://github.com/google/magika/blob/af1baf4857bf39756ec7516bede78e6294c86cea/js/magika_node.ts#L77-L80 "Source code on GitHub"
[24]: https://github.com/google/magika/blob/0577a5b218db5dbfbf88f968ba9da701a397ec2f/js/magika_node.ts#L77-L80 "Source code on GitHub"

[25]: https://github.com/google/magika/blob/af1baf4857bf39756ec7516bede78e6294c86cea/js/magika_node.ts#L87-L91 "Source code on GitHub"
[25]: https://github.com/google/magika/blob/0577a5b218db5dbfbf88f968ba9da701a397ec2f/js/magika_node.ts#L87-L91 "Source code on GitHub"

[26]: https://github.com/google/magika/blob/af1baf4857bf39756ec7516bede78e6294c86cea/js/magika_node.ts#L98-L101 "Source code on GitHub"
[26]: https://github.com/google/magika/blob/0577a5b218db5dbfbf88f968ba9da701a397ec2f/js/magika_node.ts#L98-L101 "Source code on GitHub"

[27]: https://github.com/google/magika/blob/af1baf4857bf39756ec7516bede78e6294c86cea/js/magika.ts#L27-L123 "Source code on GitHub"
[27]: https://github.com/google/magika/blob/0577a5b218db5dbfbf88f968ba9da701a397ec2f/js/magika.ts#L27-L123 "Source code on GitHub"

[28]: https://github.com/google/magika/blob/af1baf4857bf39756ec7516bede78e6294c86cea/js/magika.ts#L52-L57 "Source code on GitHub"
[28]: https://github.com/google/magika/blob/0577a5b218db5dbfbf88f968ba9da701a397ec2f/js/magika.ts#L52-L57 "Source code on GitHub"

[29]: https://github.com/google/magika/blob/af1baf4857bf39756ec7516bede78e6294c86cea/js/magika.ts#L64-L67 "Source code on GitHub"
[29]: https://github.com/google/magika/blob/0577a5b218db5dbfbf88f968ba9da701a397ec2f/js/magika.ts#L64-L67 "Source code on GitHub"

[30]: https://github.com/google/magika/blob/af1baf4857bf39756ec7516bede78e6294c86cea/js/magika.ts#L74-L77 "Source code on GitHub"
[30]: https://github.com/google/magika/blob/0577a5b218db5dbfbf88f968ba9da701a397ec2f/js/magika.ts#L74-L77 "Source code on GitHub"

0 comments on commit a3ab159

Please sign in to comment.