Skip to content

GLSP-1578: Switch to github actions (#115) #4

GLSP-1578: Switch to github actions (#115)

GLSP-1578: Switch to github actions (#115) #4

Workflow file for this run

name: CI
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
name: Build
timeout-minutes: 60
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: 20.x
- name: Build
run: yarn install
- name: Bundle browser example
working-directory: examples/workflow-server
run: yarn bundle:browser
- name: Check for uncommitted changes in yarn.lock
run: |
if git diff --name-only | grep -q "^yarn.lock"; then
echo "::error::The yarn.lock file has uncommitted changes!"
exit 1
fi
test:
name: Test
timeout-minutes: 60
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: 20.x
- name: Install
run: |
yarn install
- name: Test
run: |
yarn test:ci
- name: Publish Test Report
uses: ctrf-io/github-test-reporter@646f98cfc16c6f7a0e1f6100cabe2deb95dd2eef # v1.0.22
with:
report-path: 'packages/*/ctrf/*.json'
summary-report: true
file-report: true
if: always()
lint:
name: Lint
timeout-minutes: 60
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: 20.x
- name: Install
run: |
yarn install
- name: Create eslint json report
run: |
yarn lint:ci
- name: Create summary
if: always()
run: |
npm_config_yes=true npx github:10up/eslint-json-to-md#82ff16b --path ./eslint_report.json --output ./eslint_report.md
cat eslint_report.md >> $GITHUB_STEP_SUMMARY
coverage:
name: Coverage
timeout-minutes: 60
runs-on: ubuntu-22.04
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: 20.x
- name: Install
run: |
yarn install
- name: Run Coverage Tests
run: |
yarn test:coverage:ci
- name: Upload Coverage Report
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: coverage-report
path: coverage/
if: always()