Skip to content

Merge branch 'main' of github.com:mparkachov/lambda-shell-runtime #26

Merge branch 'main' of github.com:mparkachov/lambda-shell-runtime

Merge branch 'main' of github.com:mparkachov/lambda-shell-runtime #26

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
checks: write
id-token: write
jobs:
build-and-test:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up SAM CLI
uses: aws-actions/setup-sam@v2
- name: Build layer (amd64)
run: make build-amd64
- name: Run ShellSpec (smoke)
id: shellspec_smoke
continue-on-error: true
run: SHELLSPEC_ARGS='--output junit --shell /bin/sh --reportdir report/smoke' make test-smokespec
- name: Run ShellSpec (runtime errors)
id: shellspec_error
continue-on-error: true
run: SHELLSPEC_ARGS='--output junit --shell /bin/sh --reportdir report/error' make test-errorspec
- name: Run ShellSpec (integration)
id: shellspec_integration
continue-on-error: true
run: SHELLSPEC_ARGS='--output junit --shell /bin/sh --reportdir report/integration' make test-integration
- name: Upload smoke test report
if: always()
uses: actions/upload-artifact@v4
with:
name: shellspec-smoke-junit
path: report/smoke/results_junit.xml
if-no-files-found: warn
- name: Upload runtime error test report
if: always()
uses: actions/upload-artifact@v4
with:
name: shellspec-error-junit
path: report/error/results_junit.xml
if-no-files-found: warn
- name: Upload integration test report
if: always()
uses: actions/upload-artifact@v4
with:
name: shellspec-integration-junit
path: report/integration/results_junit.xml
if-no-files-found: warn
- name: Publish smoke test report
if: always()
uses: dorny/test-reporter@v1
with:
name: shellspec-smoke
path: report/smoke/results_junit.xml
reporter: java-junit
fail-on-error: false
- name: Publish runtime error test report
if: always()
uses: dorny/test-reporter@v1
with:
name: shellspec-error
path: report/error/results_junit.xml
reporter: java-junit
fail-on-error: false
- name: Publish integration test report
if: always()
uses: dorny/test-reporter@v1
with:
name: shellspec-integration
path: report/integration/results_junit.xml
reporter: java-junit
fail-on-error: false
- name: Fail if tests failed
if: steps.shellspec_smoke.outcome != 'success' || steps.shellspec_error.outcome != 'success' || steps.shellspec_integration.outcome != 'success'
run: exit 1
- name: Configure AWS credentials (OIDC)
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
- name: Log AWS caller identity
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: aws sts get-caller-identity
- name: Publish and deploy dev SAR (amd64)
if: github.ref == 'refs/heads/main' && github.event_name == 'push' && steps.shellspec_smoke.outcome == 'success' && steps.shellspec_error.outcome == 'success' && steps.shellspec_integration.outcome == 'success'
env:
ENV: dev
run: |
make delete-sar ARCH=amd64
make publish-sar ARCH=amd64
make deploy-sar ARCH=amd64