Add cross-repo trigger #512
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
typescript-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install node dependencies | |
run: npm ci | |
- name: Run typescript | |
run: npx tsc -p tests/tsconfig.json --noEmit | |
code-style: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install node dependencies | |
run: npm ci | |
- name: Prettier check (tests and certain files) | |
run: npm run prettier-check | |
jest-unit-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# Setup java for access to `ant` | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Install node dependencies | |
run: npm ci | |
- name: Test building with ant | |
run: | | |
cd resources/build && ant && cd .. | |
- name: Run js unit tests | |
run: npm run test | |
trigger-playwright-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Trigger workflow_dispatch on test repository | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{secrets.BOT_TOKEN}} | |
script: | | |
github.rest.actions.createWorkflowDispatch({ | |
owner: 'helioviewer-project', | |
repo: 'helioviewer.org-tests', | |
workflow_id: 'ci.yml', | |
ref: 'main', | |
inputs: { | |
test_pr: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || '''''' }} | |
} | |
}) |