From 7bc2a00ad8b9d6ab1ec394d1e06f39a6a471e5d2 Mon Sep 17 00:00:00 2001 From: Mingfei Shao Date: Tue, 7 Nov 2023 17:00:17 -0600 Subject: [PATCH 1/4] move to gh action --- .github/workflows/ci.yaml | 37 +++++++++++++++++++++++++ .github/workflows/image_build_push.yaml | 13 --------- .travis.yml | 20 ------------- 3 files changed, 37 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/ci.yaml delete mode 100644 .github/workflows/image_build_push.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..acdc9a6f --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,37 @@ +name: CI + +on: + push: + pull_request: + types: [opened, reopened] + +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: true + + +jobs: + Security: + name: Security Pipeline + uses: uc-cdis/.github/.github/workflows/securitypipeline.yaml@master + with: + python-poetry: 'false' + secrets: inherit + + ci: + name: Build Image and Push + uses: uc-cdis/.github/.github/workflows/image_build_push.yaml@master + secrets: + ECR_AWS_ACCESS_KEY_ID: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }} + ECR_AWS_SECRET_ACCESS_KEY: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }} + QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} + QUAY_ROBOT_TOKEN: ${{ secrets.QUAY_ROBOT_TOKEN }} + + unit_test: + name: NPM Unit Test + uses: uc-cdis/.github/.github/workflows/npm_unit_test.yaml@master + with: + node-version: '16' + npm-version: '8.5' + pre-test: 'npm run relay && npm run params && COMMIT=`git rev-parse HEAD` && echo "export const gitCommit = \"${COMMIT}\";" >src/server/version.js && VERSION=`git describe --always --tags` && echo "export const gitVersion =\"${VERSION}\";" >>src/server/version.js && npm run eslint' + post-test: 'bash ./testSchema.sh' diff --git a/.github/workflows/image_build_push.yaml b/.github/workflows/image_build_push.yaml deleted file mode 100644 index 2221aee4..00000000 --- a/.github/workflows/image_build_push.yaml +++ /dev/null @@ -1,13 +0,0 @@ -name: Build Image and Push to Quay - -on: push - -jobs: - ci: - name: Build Image and Push to Quay - uses: uc-cdis/.github/.github/workflows/image_build_push.yaml@master - secrets: - ECR_AWS_ACCESS_KEY_ID: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }} - ECR_AWS_SECRET_ACCESS_KEY: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }} - QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} - QUAY_ROBOT_TOKEN: ${{ secrets.QUAY_ROBOT_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f4c29415..00000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: node_js -git: - depth: 1 -node_js: - - "16" - -services: - - docker - -before_install: - - npm install -g npm@8.5 - - COMMIT=`git rev-parse HEAD` && echo "export const gitCommit = \"${COMMIT}\";" >src/server/version.js - - VERSION=`git describe --always --tags` && echo "export const gitVersion =\"${VERSION}\";" >>src/server/version.js - -install: - - npm ci - -script: - - npm run eslint - - npm run test From 9e8af2e870022b09ed920043d27002d4ba666a75 Mon Sep 17 00:00:00 2001 From: Mingfei Shao Date: Tue, 7 Nov 2023 17:00:29 -0600 Subject: [PATCH 2/4] fix --- .github/workflows/ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index acdc9a6f..1d714666 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -34,4 +34,3 @@ jobs: node-version: '16' npm-version: '8.5' pre-test: 'npm run relay && npm run params && COMMIT=`git rev-parse HEAD` && echo "export const gitCommit = \"${COMMIT}\";" >src/server/version.js && VERSION=`git describe --always --tags` && echo "export const gitVersion =\"${VERSION}\";" >>src/server/version.js && npm run eslint' - post-test: 'bash ./testSchema.sh' From dd94f654c8a0628818e831b82c054ed31cd51372 Mon Sep 17 00:00:00 2001 From: Mingfei Shao Date: Tue, 7 Nov 2023 17:02:01 -0600 Subject: [PATCH 3/4] fix for npm --- .github/workflows/ci.yaml | 5 +++-- Dockerfile | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1d714666..c6a89498 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,5 +32,6 @@ jobs: uses: uc-cdis/.github/.github/workflows/npm_unit_test.yaml@master with: node-version: '16' - npm-version: '8.5' - pre-test: 'npm run relay && npm run params && COMMIT=`git rev-parse HEAD` && echo "export const gitCommit = \"${COMMIT}\";" >src/server/version.js && VERSION=`git describe --always --tags` && echo "export const gitVersion =\"${VERSION}\";" >>src/server/version.js && npm run eslint' + npm-version: '8' + pre-test: 'COMMIT=`git rev-parse HEAD` && echo "export const gitCommit = \"${COMMIT}\";" >src/server/version.js && VERSION=`git describe --always --tags` && echo "export const gitVersion =\"${VERSION}\";" >>src/server/version.js' + post-test: 'npm run eslint' diff --git a/Dockerfile b/Dockerfile index 258bcd00..59c5ad4f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN apt-get update \ && curl -sL https://deb.nodesource.com/setup_16.x | bash - \ && apt-get install -y --no-install-recommends nodejs \ && rm -rf /var/lib/apt/lists/* \ - && npm install -g npm@8.5 + && npm install -g npm@8 COPY . /guppy/ WORKDIR /guppy From 74bf2701303b2b032c3bf20e8f9d8c2e93cdc1b4 Mon Sep 17 00:00:00 2001 From: Mingfei Shao Date: Tue, 7 Nov 2023 17:04:35 -0600 Subject: [PATCH 4/4] fix --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c6a89498..2944cda9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,5 +33,5 @@ jobs: with: node-version: '16' npm-version: '8' - pre-test: 'COMMIT=`git rev-parse HEAD` && echo "export const gitCommit = \"${COMMIT}\";" >src/server/version.js && VERSION=`git describe --always --tags` && echo "export const gitVersion =\"${VERSION}\";" >>src/server/version.js' + pre-test: 'COMMIT=`git rev-parse HEAD` && echo "export const gitCommit = \"${COMMIT}\";" >server/version.js && VERSION=`git describe --always --tags` && echo "export const gitVersion =\"${VERSION}\";" >>server/version.js' post-test: 'npm run eslint'