Skip to content

V9

V9 #18

name: Cookiecutter Template Test
permissions:
contents: read
env:
NODE_VERSION: "22"
PYTHON_VERSION: "3.14"
AWS_REGION: "us-east-1"
on:
workflow_dispatch:
pull_request:
branches: [main]
jobs:
setup:
runs-on: ubuntu-latest
environment: ci
permissions:
id-token: write # required for requesting the JWT (GitHub OIDC)
steps:
- run: |
echo "🎉 The job was automatically triggered by a ${{ env.EVENT_NAME }} event." >> $GITHUB_STEP_SUMMARY
echo "🐧 This job is now running on a ${{ env.OS_NAME }} ${{env.OS_ARCH}} server hosted by GitHub!" >> $GITHUB_STEP_SUMMARY
echo "🔎 The name of your branch is ${{ env.BRANCH_NAME }} and your repository is ${{ env.REPO_NAME }}." >> $GITHUB_STEP_SUMMARY
env:
EVENT_NAME: ${{ github.event_name}}
OS_NAME: ${{ runner.os }}
OS_ARCH: ${{runner.arch }}
BRANCH_NAME: ${{ github.ref }}
REPO_NAME: ${{ github.repository }}
- name: Check out repository code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install uv
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.0
with:
enable-cache: true
- name: Set up Python
run: uv python install ${{ env.PYTHON_VERSION }}
- name: Install poetry
run: pipx install poetry
- name: Install dependencies
run: |
pip install --upgrade pip poetry
poetry config --local virtualenvs.in-project true
poetry install --no-root
npm ci
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df # v4.2.1
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
role-session-name: ${{ env.SESSION_NAME }}
aws-region: ${{ env.AWS_REGION }}
env:
SESSION_NAME: "github-${{github.sha}}-dev"
- name: Run Cookiecutter with predefined answers
run: |
poetry run cookiecutter --no-input .
- name: Set up Node
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: Run make pr command
run: |
cd my_serverless_service
make dev
make pr
make coverage
make destroy