Skip to content

Commit

Permalink
Improved pre-commit hooks, fixed suggestions, squashed commits (#456)
Browse files Browse the repository at this point in the history
Co-authored-by: rthenhaus <rthenhaus>
  • Loading branch information
rc10house authored May 21, 2024
1 parent 39c0b61 commit ec9b948
Show file tree
Hide file tree
Showing 9 changed files with 271 additions and 181 deletions.
2 changes: 1 addition & 1 deletion .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ notifications:
pullrequests_status: pr@flagon.apache.org
pullrequests_comment: notifications@flagon.apache.org
# Send dependabot PRs to commits@ instead
pullrequests_bot_dependabot: maintenance@flagon.apache.org
pullrequests_bot_dependabot: maintenance@flagon.apache.org
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ updates:
labels:
- "maintenance"
reviewers:
- 'poorejc'
- 'poorejc'
71 changes: 63 additions & 8 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#



# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

run-name: ${{ github.actor }} running CI suite
on:
push:
branches:
Expand All @@ -12,23 +31,59 @@ on:
branches:
- master
- test

jobs:
build:

pre-build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3

- name: Setup Node v${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci

- name: Format
run: npm run format

- name: Lint
run: npm run lint

- name: Check license header
uses: apache/skywalking-eyes/header@main
with:
log: info # optional: set the log level. The default value is `info`.
config: .licenserc.yaml # optional: set the config file. The default value is `.licenserc.yaml`.
mode: check # optional: Which mode License-Eye should be run in. Choices are `check` or `fix`. The default value is `check`.

build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
# See active and security support for Node.js at https://endoflife.date/nodejs

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}

- name: Setup Node v${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run test

- name: Install dependencies
run: npm ci # clean install

- name: Build
run: npm run build

- name: Test
run: npm run test

# TODO: add automatic release notes
# TODO: add cronjobs for automatically triggering new release candidates
17 changes: 17 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

bash << EOF
sound() {
echo '\a'
Expand Down
38 changes: 38 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

header:
license:
spdx-id: Apache-2.0
copyright-owner: Apache Software Foundation

paths-ignore:
- 'dist'
- 'licenses'
- 'LICENSE'
- 'NOTICE'
- 'logs'
- '**/*.json'
- '**/*.mjs'
- 'KEYS'

comment: on-failure

# If you don't want to check dependencies' license compatibility, remove the following part
dependency:
files:
- package.json # If this is a npm project.
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

ARG BUILDPLATFORM=${BUILDPLATFORM:-amd64}
FROM --platform=${BUILDPLATFORM} node:18-bullseye-slim AS flagon-node

Expand Down
19 changes: 10 additions & 9 deletions doap-userale.js.rdf
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl"?>
<rdf:RDF xml:lang="en"
xmlns="http://usefulinc.com/ns/doap#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:asfext="http://projects.apache.org/ns/asfext#"
xmlns:foaf="http://xmlns.com/foaf/0.1/">
<!--
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
Expand All @@ -21,6 +14,14 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl"?>
<rdf:RDF xml:lang="en"
xmlns="http://usefulinc.com/ns/doap#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:asfext="http://projects.apache.org/ns/asfext#"
xmlns:foaf="http://xmlns.com/foaf/0.1/">

<Project rdf:about="http://flagon.incubator.apache.org">
<created>2016-11-10</created>
<license rdf:resource="http://usefulinc.com/doap/licenses/asl20" />
Expand Down Expand Up @@ -54,4 +55,4 @@
</foaf:Person>
</maintainer>
</Project>
</rdf:RDF>
</rdf:RDF>
20 changes: 18 additions & 2 deletions example/webpackUserAleExample/dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ec9b948

Please sign in to comment.