Skip to content

Merge pull request #30 from icelam/csp #48

Merge pull request #30 from icelam/csp

Merge pull request #30 from icelam/csp #48

Workflow file for this run

name: Build
on:
push:
branches:
- 'master'
tags-ignore:
- '**' # prevent double build on release tag
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- '**'
# Global variables that will be load into every shell
env:
TEST_REPORT_ESLINT_FOLDER: reports/eslint
TEST_REPORT_ESLINT_FILENAME: eslint.json
# Allow Dependabot PRs to to run correctly
# https://github.community/t/opt-in-to-allow-writable-tokens-on-dependabot-workflows/183041
permissions:
id-token: write
contents: write
pull-requests: write
checks: write
jobs:
lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
uses: ./.github/actions/setup
- name: Run eslint checking
run: |
yarn eslint src *.js *.ts --report-unused-disable-directives --format json --output-file $REPORT_PATH
env:
REPORT_PATH: ${{ env.TEST_REPORT_ESLINT_FOLDER }}/${{ env.TEST_REPORT_ESLINT_FILENAME }}
- name: Annotate lint result
if: always()
uses: ataylorme/eslint-annotate-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
report-json: ${{ env.TEST_REPORT_ESLINT_FOLDER }}/${{ env.TEST_REPORT_ESLINT_FILENAME }}
only-pr-files: false
- name: Preserve lint report as artifact
uses: actions/upload-artifact@v4
with:
name: lint-report
path: ${{ env.TEST_REPORT_ESLINT_FOLDER }}/*
retention-days: ${{ env.DEFAULT_ARTIFACT_RETENTION_DAYS }}
build:
name: Build
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
uses: ./.github/actions/setup
- name: Build
run: |
yarn build
- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ runner.os }} # artifacts zip name
path: |
dist