2023-08-23 02:32:41 +00:00
|
|
|
name: roku-analysis
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
2023-08-23 02:38:45 +00:00
|
|
|
push:
|
2023-08-23 02:32:41 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
static:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-10-27 02:46:04 +00:00
|
|
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
2023-12-18 14:05:32 +00:00
|
|
|
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4
|
2023-08-23 02:32:41 +00:00
|
|
|
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
|
2023-11-29 16:55:59 +00:00
|
|
|
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
|
2023-08-23 02:32:41 +00:00
|
|
|
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
|