Skip to content

Commit

Permalink
Wasn't quite able to do it with artifacts so instead build a composit…
Browse files Browse the repository at this point in the history
…e action
  • Loading branch information
djahandarie committed Dec 28, 2024
1 parent 35d3f36 commit 1742545
Showing 1 changed file with 33 additions and 96 deletions.
129 changes: 33 additions & 96 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,164 +10,102 @@ on:
merge_group:

jobs:
setup:
name: Setup
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: "package.json"

- name: Restore dependencies
id: restore-dependencies
uses: actions/cache@v4
with:
path: node_modules
key: js-depend-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
if: steps.restore-dependencies.outputs.cache-hit != 'true'
run: npm ci

- name: Build third-party libraries
run: npm run build:libs

- name: Upload workspace
uses: actions/upload-artifact@v4
with:
name: workspace
path: .

js:
needs: setup
name: JavaScript
runs-on: ubuntu-latest
steps:
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- name: Test JavaScript
run: npm run test:js

ts-main:
needs: setup
name: TypeScript (main)
runs-on: ubuntu-latest
steps:
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- name: Test TypeScript (main)
run: npm run test:ts:main

ts-dev:
needs: setup
name: TypeScript
name: TypeScript (dev)
runs-on: ubuntu-latest
steps:
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- name: Test TypeScript (dev)
run: npm run test:ts:dev

ts-test:
needs: setup
name: TypeScript
name: TypeScript (test)
runs-on: ubuntu-latest
steps:
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- name: Test TypeScript (test)
run: npm run test:ts:test

ts-bench:
needs: setup
name: TypeScript
name: TypeScript (bench)
runs-on: ubuntu-latest
steps:
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- name: Test TypeScript (bench)
run: npm run test:ts:bench

css:
needs: setup
name: CSS
runs-on: ubuntu-latest
steps:
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- name: Test CSS
run: npm run test:css

html:
needs: setup
name: HTML
runs-on: ubuntu-latest
steps:
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- name: Test HTML
run: npm run test:html

markdown:
needs: setup
name: Markdown
runs-on: ubuntu-latest
steps:
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- name: Test Markdown
run: npm run test:md

json:
needs: setup
name: JSON
runs-on: ubuntu-latest
steps:
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- name: Test JSON
run: npm run test:json

unit-tests:
needs: setup
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- name: Run unit tests
run: npm run test:unit
Expand All @@ -176,14 +114,11 @@ jobs:
run: npm run test:unit:options

test-build:
needs: setup
name: Test Build
runs-on: ubuntu-latest
steps:
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- name: Build Legal
run: npm run license-report:html
Expand All @@ -199,12 +134,14 @@ jobs:
fixSchemas: true

bench:
needs: setup
name: Benchmarks
runs-on: ubuntu-latest
steps:
- name: Run Benchmarks
uses: CodSpeedHQ/action@513a19673a831f139e8717bf45ead67e47f00044 # v3.2
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: npm run bench
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- name: Run Benchmarks
uses: CodSpeedHQ/action@513a19673a831f139e8717bf45ead67e47f00044 # v3.2
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: npm run bench

0 comments on commit 1742545

Please sign in to comment.