From dbfe4428aaa5bcbcfad17dce07b7f615c93df5aa Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Mon, 3 Jul 2023 18:48:31 -0400 Subject: [PATCH 1/3] Add static analysis to build job --- .github/workflows/build-prod.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build-prod.yml b/.github/workflows/build-prod.yml index 2501adad3..dee2ba340 100644 --- a/.github/workflows/build-prod.yml +++ b/.github/workflows/build-prod.yml @@ -72,6 +72,17 @@ jobs: run: npm run ropm - name: Build app for production run: npm run build-prod + - name: Use Java 17 + uses: actions/setup-java@v3 + with: + distribution: "temurin" + java-version: "17" + - name: Download the Static Channel Analysis CLI + run: | + curl -sSL "https://devtools.web.roku.com/static-channel-analysis/sca-cmd.zip" -o sca-cmd.zip + unzip sca-cmd.zip + - name: Run Analysis + run: ./sca-cmd/bin/sca-cmd ${{ github.workspace }}/build/staging --exit error - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 with: name: Jellyfin-Roku-v${{ env.newManVersion }}-${{ github.sha }} From 1ac8bfc16efbb655d297f6806973e3c62c63b48d Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Tue, 22 Aug 2023 22:32:41 -0400 Subject: [PATCH 2/3] Create seperate workflow for roku analysis --- .github/workflows/build-prod.yml | 11 --------- .github/workflows/roku-analysis.yml | 38 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/roku-analysis.yml diff --git a/.github/workflows/build-prod.yml b/.github/workflows/build-prod.yml index dee2ba340..2501adad3 100644 --- a/.github/workflows/build-prod.yml +++ b/.github/workflows/build-prod.yml @@ -72,17 +72,6 @@ jobs: run: npm run ropm - name: Build app for production run: npm run build-prod - - name: Use Java 17 - uses: actions/setup-java@v3 - with: - distribution: "temurin" - java-version: "17" - - name: Download the Static Channel Analysis CLI - run: | - curl -sSL "https://devtools.web.roku.com/static-channel-analysis/sca-cmd.zip" -o sca-cmd.zip - unzip sca-cmd.zip - - name: Run Analysis - run: ./sca-cmd/bin/sca-cmd ${{ github.workspace }}/build/staging --exit error - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 with: name: Jellyfin-Roku-v${{ env.newManVersion }}-${{ github.sha }} diff --git a/.github/workflows/roku-analysis.yml b/.github/workflows/roku-analysis.yml new file mode 100644 index 000000000..1a3b05ac3 --- /dev/null +++ b/.github/workflows/roku-analysis.yml @@ -0,0 +1,38 @@ +name: roku-analysis + +on: + pull_request: + +env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + +jobs: + static: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 + - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 + with: + node-version: "lts/*" + cache: "npm" + - name: NPM install + run: npm ci + - name: Install roku module dependencies + run: npm run ropm + - name: Build dev app + if: env.BRANCH_NAME != 'master' + run: npm run build + - name: Build app for production + if: env.BRANCH_NAME == 'master' + run: npm run build-prod + - name: Use Java 17 + uses: actions/setup-java@v3 + with: + distribution: "temurin" + java-version: "17" + - name: Download the Static Channel Analysis CLI + run: | + curl -sSL "https://devtools.web.roku.com/static-channel-analysis/sca-cmd.zip" -o sca-cmd.zip + unzip sca-cmd.zip + - name: Run Roku Static Analysis + run: ./sca-cmd/bin/sca-cmd ${{ github.workspace }}/build/staging --exit error From b923575d0db00bab99f22389532622aacf4a60dc Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Tue, 22 Aug 2023 22:38:45 -0400 Subject: [PATCH 3/3] Run roku-analysis workflow on push --- .github/workflows/roku-analysis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/roku-analysis.yml b/.github/workflows/roku-analysis.yml index 1a3b05ac3..e046b220e 100644 --- a/.github/workflows/roku-analysis.yml +++ b/.github/workflows/roku-analysis.yml @@ -2,6 +2,7 @@ name: roku-analysis on: pull_request: + push: env: BRANCH_NAME: ${{ github.head_ref || github.ref_name }}