Skip to content

Merge pull request #90 from MoodyReaper/dependabot/npm_and_yarn/types… #195

Merge pull request #90 from MoodyReaper/dependabot/npm_and_yarn/types…

Merge pull request #90 from MoodyReaper/dependabot/npm_and_yarn/types… #195

name: Pull Request or Push to master
on:
pull_request: {}
push:
branches: [master]
workflow_dispatch: {}
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions: {}
jobs:
detect_changes:
name: Detect Changes
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
go: ${{ steps.filter.outputs.go }}
python: ${{ steps.filter.outputs.python }}
rust: ${{ steps.filter.outputs.rust }}
typescript: ${{ steps.filter.outputs.typescript }}
timeout-minutes: 2
steps:
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
go:
- 'go/**'
python:
- 'python/**'
rust:
- 'rust/**'
typescript:
- 'typescript/**'
trunk_check:
name: Trunk Check
needs: detect_changes
runs-on: ubuntu-latest
permissions:
checks: write # For Trunk to post annotations
contents: read
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Setup NodeJS
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20.11.1
cache: npm
cache-dependency-path: typescript/package-lock.json
if:
# prettier-ignore
${{ needs.detect_changes.outputs.typescript == 'true' || github.event_name == 'workflow_dispatch' }}
- name: Install package dependencies
run: npm ci
working-directory: typescript
if:
# prettier-ignore
${{ needs.detect_changes.outputs.typescript == 'true' || github.event_name == 'workflow_dispatch' }}
- name: Trunk Check
uses: trunk-io/trunk-action@540e7fe497a45ae76370d26d95cc249059c4ac3a # v1.1.12
go_build_check:
name: Go Build Check
needs: detect_changes
if: ${{ needs.detect_changes.outputs.go == 'true' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
working-directory: go
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: 1.22.1
cache-dependency-path: go/go.sum
- name: Run build check
run: go build -o bin/ src/main.go
- name: Run execution check
run: go run src/main.go
python_build_check:
name: Python Build Check
needs: detect_changes
if:
# prettier-ignore
${{ needs.detect_changes.outputs.python == 'true' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
working-directory: python
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Setup Poetry
uses: abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439 # v3.0.0
with:
poetry-version: 1.8.2
- name: Setup Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: 3.12.2
cache: poetry
cache-dependency-path: python/poetry.lock
- name: Install package dependencies
run: poetry install
- name: Run build check
run: poetry build
- name: Run execution check
run: poetry run python src/main.py
rust_build_check:
name: Rust Build Check
needs: detect_changes
if:
${{ needs.detect_changes.outputs.rust == 'true' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
working-directory: rust
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Setup Rust
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
with:
toolchain: 1.77.0
# TODO: check whether caching option was added
- name: Run build check
run: cargo build --locked --verbose
- name: Run execution check
run: cargo run
typescript_build_check:
name: TypeScript Build Check
needs: detect_changes
if:
# prettier-ignore
${{ needs.detect_changes.outputs.typescript == 'true' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
working-directory: typescript
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Setup NodeJS
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20.11.1
cache: npm
cache-dependency-path: typescript/package-lock.json
- name: Install package dependencies
run: npm ci
- name: Run build check
run: npm run dist:build
- name: Run execution check
run: npm start