refactor: restructure to vertical slice architecture with centralized… #34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI Pipeline | |
| on: | |
| push: | |
| paths-ignore: | |
| - "**.md" | |
| - LICENSE | |
| branches: | |
| - "master" | |
| pull_request: | |
| paths-ignore: | |
| - "**.md" | |
| - LICENSE | |
| branches: | |
| - master | |
| - "feature/*" | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| if: | | |
| !contains(github.event.head_commit.message, '[skip ci]') && | |
| !contains(github.event.head_commit.message, '[ci skip]') && | |
| !contains(github.event.head_commit.message, '[skip-ci]') && | |
| !contains(github.event.head_commit.message, '[ci-skip]') && | |
| !contains(github.event.head_commit.message, '***NO_CI***') | |
| env: | |
| NUGET_PACKAGES: ${{ format('{0}/.nuget/packages', github.workspace) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: "Cache NuGet packages" | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ format('{0}/.nuget/packages', github.workspace) }} | |
| key: nuget-${{ hashFiles('**/Directory.Packages.props') }}-${{ hashFiles('**/*.csproj') }}-${{ hashFiles('**/packages.lock.json') }} | |
| restore-keys: | | |
| nuget- | |
| - name: Restore .NET dependencies | |
| run: dotnet restore | |
| - name: Build solution | |
| run: dotnet build --no-restore --configuration Release | |
| - name: Run unit tests | |
| run: dotnet test --no-build --configuration Release --verbosity normal | |
| continuous-deployment: | |
| needs: build-and-test | |
| if: | | |
| github.repository == 'localstack-dotnet/badge-smith' && | |
| ((github.event_name == 'push' && github.ref == 'refs/heads/master') || | |
| (github.event_name == 'pull_request' && startsWith(github.head_ref, 'feature/'))) && | |
| !contains(github.event.head_commit.message, '[skip cd]') && | |
| !contains(github.event.head_commit.message, '[cd skip]') && | |
| !contains(github.event.head_commit.message, '[skip-cd]') && | |
| !contains(github.event.head_commit.message, '[cd-skip]') && | |
| !contains(github.event.head_commit.message, '***NO_CD***') | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Lambda ZIP for ARM64 | |
| run: | | |
| ./scripts/build-lambda.sh --target zip --rid linux-arm64 --clean --verbose | |
| - name: Upload Lambda artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ github.ref == 'refs/heads/master' && 'lambda-zip-latest' || format('lambda-zip-{0}', github.head_ref || github.ref_name) }} | |
| path: artifacts/badge-lambda-linux-arm64.zip | |
| retention-days: 30 | |
| overwrite: true |