Skip to content

Commit

Permalink
feat(ci): first attempt at reusable ci workflows (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Buck Evan committed Oct 10, 2023
1 parent fcbd96e commit 5069ad1
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/ci-reusable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI for a python package
on:
workflow_call:
inputs: &inputs
subdir:
required: true
type: string
workflow_dispatch:
<<: *inputs

defaults:
run:
# the default default is:
# bash --noprofile --norc -eo pipefail {0}
shell: bash --noprofile --norc -eo pipefail -ux {0}
working-directory: ${{ inputs.subdir }}

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@v2
name: Checkout code
- uses: actions/setup-python@v2
with:
python-version: 3.8
- run: make env
- name: Run linter
run: make lint
test:
runs-on: ubuntu-latest
strategy:
max-parallel: 3
steps:
- uses: actions/checkout@v2
name: Checkout code
- uses: actions/setup-python@v2
with:
python-version: 3.8
- run: make env
- run: make test
17 changes: 17 additions & 0 deletions .github/workflows/ci-sentry-jsonish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI for the sentry_jsonish package
on:
push:
branches:
- main
- release-sentry_jsonish/**
paths:
- sentry_jsonish/**
pull_request:
paths:
- sentry_jsonish/**

jobs:
ci:
uses: ./ci-reusable.yaml
with:
subdir: sentry_jsonish
17 changes: 17 additions & 0 deletions .github/workflows/ci-sentry-jsonnet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI for the sentry_jsonish package
on:
push:
branches:
- main
- release-sentry_jsonish/**
paths:
- sentry_jsonish/**
pull_request:
paths:
- sentry_jsonish/**

jobs:
ci:
uses: ./ci-reusable.yaml
with:
subdir: sentry_jsonish
5 changes: 4 additions & 1 deletion sentry_jsonnet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
venv := $(shell relpath $(VIRTUAL_ENV) $(CURDIR))

.PHONY: all
all: $(venv)
all: env

.PHONY: env
env: $(venv)

.PHONY: typecheck
typecheck:
Expand Down

0 comments on commit 5069ad1

Please sign in to comment.