mirror of
https://github.com/google/blockly.git
synced 2026-01-14 20:37:10 +01:00
- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs [Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much. Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
70 lines
1.5 KiB
YAML
70 lines
1.5 KiB
YAML
# This workflow will do a clean install, start the selenium server, and run
|
|
# all of our tests.
|
|
|
|
name: Node.js CI
|
|
|
|
on: [pull_request]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
matrix:
|
|
# TODO (#2114): re-enable osx build.
|
|
# os: [ubuntu-latest, macos-latest]
|
|
os: [ubuntu-latest]
|
|
node-version: [12.x, 14.x, 16.x]
|
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Reconfigure git to use HTTP authentication
|
|
run: >
|
|
git config --global url."https://github.com/".insteadOf
|
|
ssh://git@github.com/
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Npm Install
|
|
run: npm install
|
|
|
|
- name: Linux Test Setup
|
|
if: runner.os == 'Linux'
|
|
run: source ./tests/scripts/setup_linux_env.sh
|
|
|
|
- name: MacOS Test Setup
|
|
if: runner.os == 'macOS'
|
|
run: source ./tests/scripts/setup_osx_env.sh
|
|
|
|
- name: Run
|
|
run: npm run test
|
|
|
|
env:
|
|
CI: true
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js 16.x
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 16.x
|
|
|
|
- name: Npm Install
|
|
run: npm install
|
|
|
|
- name: Lint
|
|
run: npm run lint
|