Skip to content

Commit

Permalink
Merge pull request #17 from danielpeintner/issue-16
Browse files Browse the repository at this point in the history
Add GitHub Action workflows
  • Loading branch information
egekorkan authored Jun 14, 2024
2 parents 4db9ccf + 320fdfa commit b53a2f1
Show file tree
Hide file tree
Showing 10 changed files with 1,810 additions and 29 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ci-aas-aid.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: AAS AID CI Pipeline

on:
push:
branches: [main]
paths:
- "node/aas-aid/**"
pull_request:
branches: [main]
paths:
- "node/aas-aid/**"
workflow_dispatch:

defaults:
run:
working-directory: node/aas-aid

jobs:
setup-and-test:
name: Tests (${{ matrix.os }}, Node ${{ matrix.node-version }})
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node-version: [18.x, 20.x]

timeout-minutes: 30

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.os }} ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"

- name: Install
run: npm ci

- name: Build
run: npm run build

- name: Test
timeout-minutes: 10
run: npm run test:coverage

- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage/lcov.info
verbose: true
52 changes: 52 additions & 0 deletions .github/workflows/ci-async-api-converter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: AsyncAPI Converter CI Pipeline

on:
push:
branches: [main]
paths:
- "node/async-api-converter/**"
pull_request:
branches: [main]
paths:
- "node/async-api-converter/**"
workflow_dispatch:

defaults:
run:
working-directory: node/async-api-converter

jobs:
setup-and-test:
name: Tests (${{ matrix.os }}, Node ${{ matrix.node-version }})
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node-version: [18.x, 20.x]

timeout-minutes: 30

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.os }} ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"

- name: Install Dependencies
run: npm ci

- name: Test
timeout-minutes: 10
run: npm run test:coverage

- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage/lcov.info
verbose: true
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -44,7 +44,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -57,4 +57,4 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
4 changes: 2 additions & 2 deletions .github/eslint.yml → .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install ESLint
run: |
Expand All @@ -39,7 +39,7 @@ jobs:
continue-on-error: true

- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ./eslint-results.sarif
wait-for-processing: true
24 changes: 24 additions & 0 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Prettier

on:
push:
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]

jobs:
prettier:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install prettier
run: npm install [email protected]

- name: Run prettier
run: npm run format:check
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ eslint-results.sarif
# junit test results # Not relevant until validation comes here
junit-tests.xml
packages/web-new/test-results
packages/web-new/playwright-report
packages/web-new/playwright-report
**/coverage
**/.nyc_output
Loading

0 comments on commit b53a2f1

Please sign in to comment.