Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/build-docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:
pnpm_version:
description: "pnpm version to install"
required: false
default: "10.33.0"
default: "11.15.1"
pnpm_filters:
description: "Additional pnpm workspace filters passed to pnpm install"
required: false
Expand Down
27 changes: 27 additions & 0 deletions .github/actions/node-install/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Node install and setup'
description: 'Setup node with pnpm and authenticate github package repository'

inputs:
node-version:
description: 'Node.js version'
required: true
pnpm-version:
description: 'pnpm version'
required: true
GITHUB_TOKEN:
description: "Token for access to github package registry"
required: true

runs:
using: 'composite'
steps:
- name: 'Setup pnpm'
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
with:
version: '${{ inputs.pnpm-version }}'

- name: 'Use Node.js'
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: '${{ inputs.node-version }}'
cache: 'pnpm'
39 changes: 39 additions & 0 deletions .github/workflows/release_created.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
name: Github Release Created

on:
workflow_call:
inputs:
nodejs_version:
description: "Node.js version, set by the CI/CD pipeline workflow"
required: true
type: string
pnpm_version:
description: "pnpm version, set by the CI/CD pipeline workflow"
required: true
type: string
release:
types: ["published"] # Inherits all input defaults

Expand All @@ -9,6 +19,23 @@ concurrency:
cancel-in-progress: false

jobs:
metadata:
name: "Set CI/CD metadata"
runs-on: ubuntu-latest
timeout-minutes: 1
permissions:
contents: read
outputs:
nodejs_version: ${{ steps.variables.outputs.nodejs_version }}
pnpm_version: ${{ steps.variables.outputs.pnpm_version }}
steps:
- name: "Checkout code"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: "Set CI/CD variables"
id: variables
run: |
echo "nodejs_version=$(grep "^nodejs\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
echo "pnpm_version=$(grep "^pnpm\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
deploy-main:
name: Package and Publish Terraform Modules to GitHub Releases assets
runs-on: ubuntu-latest
Expand All @@ -20,13 +47,25 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Node install and setup
uses: ./.github/actions/node-install
with:
node-version: ${{ inputs.nodejs_version }}
pnpm-version: ${{ inputs.pnpm_version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Install dependencies"
run: pnpm install --frozen-lockfile
- name: "Package and Publish Terraform modules"
run: |
ARTIFACTS_DIR="$PWD/../../artifacts"
mkdir -p "$ARTIFACTS_DIR"
cd infrastructure/terraform/modules
for module in */; do
module_name=${module%/}
if [ -f "$module_name/pre.sh" ]; then
echo "Running pre.sh for $module_name..."
(cd "$module_name" && bash pre.sh)
fi
echo "Zipping contents of $module_name..."
(cd "$module_name" && zip -r "$ARTIFACTS_DIR/terraform-${module_name}.zip" .)
echo "Publishing $module_name module..."
Expand Down
84 changes: 65 additions & 19 deletions .github/workflows/stage-2-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,43 +40,89 @@ jobs:
test-unit:
name: "Unit tests"
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 15
permissions:
contents: read
packages: read
steps:
- name: "Checkout code"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Node install and setup
uses: ./.github/actions/node-install
with:
node-version: ${{ inputs.nodejs_version }}
pnpm-version: ${{ inputs.pnpm_version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Install dependencies"
run: pnpm install --frozen-lockfile
- name: "Run unit test suite"
run: |
make test-unit
- name: "Save the result of fast test suite"
run: |
echo "Nothing to save"
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: unit-tests
path: |
src/**/.reports/unit/test-report.html
utils/**/.reports/unit/test-report.html
lambdas/**/.reports/unit/test-report.html
tests/**/.reports/unit/test-report.html
!**/node_modules/**
include-hidden-files: true
if: always()
- name: "Save the result of code coverage"
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: code-coverage-report
path: ".reports/lcov.info"
- name: "Save Python coverage reports"
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: python-coverage-reports
path: |
src/**/coverage.xml
utils/**/coverage.xml
lambdas/**/coverage.xml
test-lint:
name: "Linting"
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 8
permissions:
contents: read
packages: read
steps:
- name: "Checkout code"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Node install and setup
uses: ./.github/actions/node-install
with:
pnpm-version: ${{ inputs.pnpm_version }}
node-version: ${{ inputs.nodejs_version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Run linting"
run: |
make test-lint
- name: "Save the linting result"
run: |
echo "Nothing to save"
test-coverage:
name: "Test coverage"
needs: [test-unit]
test-typecheck:
name: "Typecheck"
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 6
permissions:
contents: read
packages: read
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: "Checkout code"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: "Run test coverage check"
run: |
make test-coverage
- name: "Save the coverage check result"
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Node install and setup
uses: ./.github/actions/node-install
with:
pnpm-version: ${{ inputs.pnpm_version }}
node-version: ${{ inputs.nodejs_version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Run typecheck"
run: |
echo "Nothing to save"
make test-typecheck
perform-static-analysis:
name: "Perform static analysis"
needs: [test-unit]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ node_modules
dist
.DS_Store
.reports
.turbo
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ act 0.2.64
gitleaks 8.24.0
jq 1.6
nodejs 22.15.1
pnpm 10.33.0
pre-commit 3.6.0
pnpm 11.15.1
terraform 1.10.1
terraform-docs 0.19.0
trivy 0.69.2
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include scripts/init.mk
# Example CI/CD targets are: dependencies, build, publish, deploy, clean, etc.

dependencies: # Install dependencies needed to build and test the project @Pipeline
# TODO: Implement installation of your project dependencies
pnpm install

build: # Build the project artefact @Pipeline
(cd docs && make build)
Expand All @@ -21,6 +21,7 @@ deploy: # Deploy the project artefact to the target environment @Pipeline

clean:: # Clean-up project resources (main) @Operations
rm -f .version
pnpm run clean
# TODO: Implement project resources clean-up step

config:: _install-dependencies version # Configure development environment (main) @Configuration
Expand All @@ -30,6 +31,7 @@ version:
rm -f .version
make version-create-effective-file dir=.
echo "{ \"schemaVersion\": 1, \"label\": \"version\", \"message\": \"$$(head -n 1 .version 2> /dev/null || echo unknown)\", \"color\": \"orange\" }" > version.json

# ==============================================================================

${VERBOSE}.SILENT: \
Expand Down
Loading
Loading