Skip to content

Commit

Permalink
ci: add GitHub Actions config (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
henrybell authored Oct 30, 2024
1 parent 99e4dc3 commit 59c3e7f
Show file tree
Hide file tree
Showing 4 changed files with 186 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright 2024 Google LLC
#
# Licensed 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.

---
updates:
# Github-actions dependencies
- directory: "/"
package-ecosystem: "github-actions"
schedule:
interval: "weekly"
commit-message:
prefix: "fix"

# NPM dependencies -- only prompt to update minor versions.
- directory: "/"
package-ecosystem: "npm"
schedule:
interval: "weekly"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
commit-message:
prefix: "fix"

# Docker dependencies
- directory: "/"
package-ecosystem: "docker"
schedule:
interval: "weekly"
commit-message:
prefix: "fix"

# Terraform dependencies
- directory: "/terraform"
package-ecosystem: "terraform"
schedule:
interval: "weekly"
commit-message:
prefix: "fix"

version: 2
23 changes: 23 additions & 0 deletions .github/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2024 Google LLC
#
# Licensed 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.

handleGHRelease: true
manifest: true
branches:
- branch: version_1
handleGHRelease: true
manifest: true
- branch: version_2
handleGHRelease: true
manifest: true
66 changes: 66 additions & 0 deletions .github/workflows/codehealth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Copyright 2024 Google LLC
#
# Licensed 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.

name: "Code health checks (npm audit, eslint, tscompiler, ...)"

on:
push:
pull_request:

jobs:
analyze:
name: "Analyze"
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
strategy:
fail-fast: false

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

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
check-latest: true

- name: Use terraform
uses: hashicorp/setup-terraform@v3

- name: Install node modules
run: npm install

- name: Execute "npm run typecheck"
run: npm run typecheck

- name: Execute "npm run eslint"
run: npm run eslint

- name: Execute "npm run check-format"
run: npm run check-format

- name: Execute "npm run mdlint"
run: npm run mdlint

- name: Execute "npm audit"
run: npm audit

- name: Execute "npm run markdown-link-check"
run: npm run markdown-link-check

- name: terraform validate deployments
run: npm run terraform-validate
45 changes: 45 additions & 0 deletions .github/workflows/unit_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 2024 Google LLC
#
# Licensed 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.

name: Node.js unit tests

on: [push, pull_request]

jobs:
unit-tests:
runs-on: ubuntu-latest

defaults:
run:
working-directory: src/poller/poller-core

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: npm install
run: npm install

- name: Unit tests
run: npm test
env:
CI: true

0 comments on commit 59c3e7f

Please sign in to comment.