-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add GHA test.yml, codeql, and dependabot.yml (#136)
- Loading branch information
Showing
8 changed files
with
162 additions
and
47 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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: "Code scanning - action" | ||
|
||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: '0 19 * * 0' | ||
|
||
jobs: | ||
CodeQL-Build: | ||
|
||
# CodeQL runs on ubuntu-latest and windows-latest | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- 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' }} | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
# Override language selection by uncommenting this and choosing your languages | ||
# with: | ||
# languages: go, javascript, csharp, python, cpp, java | ||
|
||
# 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@v3 | ||
|
||
# ℹ️ 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 | ||
|
||
#- run: | | ||
# make bootstrap | ||
# make release | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 |
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,14 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: docker | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
time: '11:00' | ||
open-pull-requests-limit: 10 | ||
- package-ecosystem: pip | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
time: '11:00' | ||
open-pull-requests-limit: 10 |
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,88 @@ | ||
name: KBase Catalog test | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
push: | ||
# run workflow when merging to main or develop | ||
branches: | ||
- main | ||
- master | ||
- develop | ||
|
||
jobs: | ||
catalog_tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- python-version: '3.7' | ||
mongo-version: '3.6' | ||
# - python-version: '3.7' | ||
# mongo-version: '7.0.4' | ||
services: | ||
mongo: | ||
image: mongo:${{matrix.mongo-version}} | ||
ports: | ||
- 27017:27017 | ||
options: --name mongo${{matrix.mongo-version}} | ||
|
||
steps: | ||
- name: Repo checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{matrix.python-version}} | ||
|
||
- name: Install dependencies and set up test config | ||
shell: bash | ||
env: | ||
KBASE_CI_TOKEN: ${{ secrets.KBASE_CI_TOKEN }} | ||
ADMIN_USER: ${{ secrets.KBASE_BOT_USER_CI }} | ||
|
||
run: | | ||
# test mongo connection | ||
curl http://localhost:27017 | ||
returncode=$? | ||
if [ $returncode != 0 ]; then exit $returncode; fi | ||
# set HOMEDIR | ||
export HOMEDIR=`pwd` | ||
# move to parent dir to install binaries etc | ||
cd .. | ||
# setup kb-sdk | ||
mkdir -p $(pwd)/bin | ||
docker run ghcr.io/kbase/kb_sdk_patch-develop:br-0.0.4 genscript > $(pwd)/bin/kb-sdk | ||
chmod 755 $(pwd)/bin/kb-sdk | ||
export PATH=$(pwd)/bin:$PATH | ||
# install catalog dependencies | ||
cd $HOMEDIR | ||
pip install -r requirements.txt | ||
# setup test config | ||
cp -n test/test.cfg.example test/test.cfg | ||
sed -i "s#^nms-admin-token.*#nms-admin-token=$KBASE_CI_TOKEN#" test/test.cfg | ||
sed -i "s#^method-spec-admin-users.*#method-spec-admin-users=$ADMIN_USER#" test/test.cfg | ||
- name: Run tests | ||
shell: bash | ||
run: make test | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
fail_ci_if_error: true |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pymongo==3.7 | ||
pymongo==3.10 | ||
docker>=3.5 | ||
gitpython | ||
pyyaml | ||
|
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