Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 0 additions & 55 deletions .github/workflows/build-macos.yml

This file was deleted.

55 changes: 0 additions & 55 deletions .github/workflows/build-ubuntu.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/build-windows.yml

This file was deleted.

95 changes: 95 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: "CI/CD Pipeline"

on:
push:
paths-ignore:
- "**.md"
- LICENSE
branches:
- "master"
pull_request:
paths-ignore:
- "**.md"
- LICENSE
branches:
- master
- "feature/*"

env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: true

jobs:
build-and-test:
name: "Build & Test (${{ matrix.name }})"
runs-on: ${{ matrix.os }}
env:
NUGET_PACKAGES: ${{ contains(matrix.os, 'windows') && format('{0}\.nuget\packages', github.workspace) || format('{0}/.nuget/packages', github.workspace) }}

strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
name: "Windows"
script: "./build.ps1"

- os: ubuntu-22.04
name: "Linux"
script: "./build.sh"

- os: macos-latest
name: "macOS"
script: "./build.sh"

steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for better caching

- name: "Setup .NET SDK"
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x

- name: "Make build script executable"
if: runner.os != 'Windows'
run: chmod +x ./build.sh

- name: "Cache NuGet packages"
uses: actions/cache@v4
with:
path: ${{ runner.os == 'Windows' && format('{0}\.nuget\packages', github.workspace) || format('{0}/.nuget/packages', github.workspace) }}
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json', '**/*.csproj', '**/Directory.Packages.props') }}
restore-keys: |
${{ runner.os }}-nuget-

- name: "Build"
run: ${{ matrix.script }} --target build

- name: "Run Tests"
run: ${{ matrix.script }} --target tests --skipFunctionalTest ${{ runner.os == 'Linux' && 'false' || 'true' }} --exclusive

- name: "Publish Test Results"
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: 'Test Results (${{ matrix.name }})'
path: '**/TestResults/*.trx'
reporter: 'dotnet-trx'
fail-on-error: true
max-annotations: 50

- name: "Upload Test Artifacts"
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-results-${{ matrix.name }}
path: |
**/*.trx
**/TestResults/**/*
retention-days: 7
Comment on lines +25 to +95

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 6 months ago

To resolve the issue, we will add an explicit permissions block at the root of the workflow file. This will apply to all jobs in the workflow unless overridden by job-specific permissions. Based on the tasks performed in the workflow (e.g., checkout, caching, uploading artifacts), the minimal necessary permissions are as follows:

  • contents: read: Required for accessing repository contents.
  • actions: write: Required for uploading artifacts.

The permissions block should be added immediately after the name field in the workflow file.

Suggested changeset 1
.github/workflows/ci.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,3 +1,6 @@
+permissions:
+  contents: read
+  actions: write
 name: "CI/CD Pipeline"
 
 on:
EOF
@@ -1,3 +1,6 @@
permissions:
contents: read
actions: write
name: "CI/CD Pipeline"

on:
Copilot is powered by AI and may make mistakes. Always verify output.
@Blind-Striker Blind-Striker committed this autofix suggestion 6 months ago.
27 changes: 27 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Dependency Review

on:
pull_request:
branches:
- master
- "feature/*"

permissions:
contents: read
pull-requests: write

jobs:
dependency-review:
name: "Dependency Review"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4

- name: "Dependency Review"
uses: actions/dependency-review-action@v4
with:
# Fail the check if a vulnerability with 'moderate' severity or higher is found.
fail-on-severity: moderate
# Always post a summary of the check as a comment on the PR.
comment-summary-in-pr: always
99 changes: 99 additions & 0 deletions .github/workflows/publish-dev-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: "Auto Publish to GitHub Packages"

on:
push:
branches:
- master
paths-ignore:
- "**.md"
- LICENSE
- ".github/**"
- "docs/**"

env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: true

jobs:
auto-publish:
name: "Auto Publish Development Build"
runs-on: ubuntu-22.04
if: github.repository == 'localstack-dotnet/localstack-dotnet-client'
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages

permissions:
contents: read
packages: write

steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: "Setup .NET SDK"
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x

- name: "Cache NuGet packages"
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json', '**/*.csproj', '**/Directory.Packages.props') }}
restore-keys: |
${{ runner.os }}-nuget-

- name: "Make build script executable"
run: chmod +x ./build.sh

- name: "Build & Test"
run: ./build.sh --target tests --skipFunctionalTest true

- name: "Setup GitHub Packages Authentication"
run: |
dotnet nuget add source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json \
--name github-packages \
--username ${{ github.actor }} \
--password ${{ secrets.GITHUB_TOKEN }} \
--store-password-in-clear-text

- name: "Pack & Publish LocalStack.Client"
run: |
echo "πŸ”¨ Building and publishing LocalStack.Client package..."
./build.sh --target nuget-pack-and-publish \
--package-source github \
--package-id LocalStack.Client \
--use-directory-props-version true \
--branch-name ${{ github.ref_name }} \
--package-secret ${{ secrets.GITHUB_TOKEN }}

- name: "Pack & Publish LocalStack.Client.Extensions"
run: |
echo "πŸ”¨ Building and publishing LocalStack.Client.Extensions package..."
./build.sh --target nuget-pack-and-publish \
--package-source github \
--package-id LocalStack.Client.Extensions \
--use-directory-props-version true \
--branch-name ${{ github.ref_name }} \
--package-secret ${{ secrets.GITHUB_TOKEN }}

- name: "Upload Package Artifacts"
uses: actions/upload-artifact@v4
with:
name: "dev-packages-${{ github.run_number }}"
path: |
artifacts/*.nupkg
artifacts/*.snupkg
retention-days: 7

- name: "Generate Build Summary"
run: |
echo "πŸ“¦ Generating build summary..."
./build.sh --target workflow-summary \
--use-directory-props-version true \
--branch-name ${{ github.ref_name }}
Loading
Loading