Skip to content

Commit

Permalink
ci: mixed actions updates (#102)
Browse files Browse the repository at this point in the history
* chore(deps): update github-actions

* chore(deps): update github-actions

* ci: update actions

* chore: re-formatted

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
chgl and renovate[bot] authored Feb 2, 2024
1 parent 11cb273 commit e80ab02
Show file tree
Hide file tree
Showing 21 changed files with 274 additions and 342 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/benchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

Expand All @@ -37,7 +37,7 @@ jobs:
run: dotnet run -c Release --project=src/Vfps.Benchmarks

- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@70405016b032d44f409e4b1b451c40215cbe2393 # v1.18.0
uses: benchmark-action/github-action-benchmark@cc9ac13ce81036c9b67fcfe2cb95ca366684b9ea # v1.19.3
with:
name: PseudonymGeneratorBenchmarks
tool: "benchmarkdotnet"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: bufbuild/buf-setup-action@382440cdb8ec7bc25a68d7b4711163d95f7cc3aa # v1.28.1
- uses: bufbuild/buf-setup-action@88db93f5d74ffa329bb43e42aa95cd822697d214 # v1.29.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build-grpc-utils-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,31 @@ jobs:
contents: read
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Container meta for the gRPC utils image
id: container_grpc_utils_meta
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v4
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5
with:
images: |
ghcr.io/${{ github.repository }}-grpc-utils
- name: Set up QEMU
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3

- name: Login to GitHub Container Registry
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
if: ${{ github.event_name != 'pull_request' }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push gRPC utils image
uses: docker/build-push-action@1104d471370f9806843c095c1db02b5a90c5f8b6 # v3
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.container_grpc_utils_meta.outputs.tags }}
Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions: read-all

jobs:
build:
uses: miracum/.github/.github/workflows/standard-build.yaml@402d475fc7f49888381ea1090ddc2004ac8a8e59 # v1.5.3
uses: miracum/.github/.github/workflows/standard-build.yaml@d312bc78e5a4ab6bafc71979f80962177abc6336 # v1.5.7
permissions:
contents: read
id-token: write
Expand All @@ -36,9 +36,9 @@ jobs:
pull-requests: write
steps:
- name: Download test image
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
name: test-image
name: ${{ needs.build.outputs.image-slug }}-test
path: /tmp

- name: Load test image
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
thresholds: "50 50"

- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@efaaab3fd41a9c3de579aba759d2552635e590fd # v2.8.0
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2.9.0
if: ${{ github.event_name == 'pull_request' }}
with:
recreate: true
Expand All @@ -84,13 +84,13 @@ jobs:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Download container image
if: ${{ github.event_name == 'pull_request' }}
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
name: container-image
name: ${{ needs.build.outputs.image-slug }}
path: /tmp

- name: Load image
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
} >> ghz-output.md
- name: Append sticky comment with ghz output
uses: marocchino/sticky-pull-request-comment@efaaab3fd41a9c3de579aba759d2552635e590fd # v2.8.0
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2.9.0
if: ${{ github.event_name == 'pull_request' }}
with:
append: true
Expand All @@ -185,13 +185,13 @@ jobs:
- build
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Download container image
if: ${{ github.event_name == 'pull_request' }}
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
name: container-image
name: ${{ needs.build.outputs.image-slug }}
path: /tmp

- name: Load image
Expand Down Expand Up @@ -222,7 +222,7 @@ jobs:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: install iter8 cli
env:
Expand All @@ -240,9 +240,9 @@ jobs:

- name: Download container image
if: ${{ github.event_name == 'pull_request' }}
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
name: container-image
name: ${{ needs.build.outputs.image-slug }}
path: /tmp

- name: Load image into KinD
Expand Down Expand Up @@ -291,15 +291,15 @@ jobs:
} >> iter8-output.md
- name: Append sticky comment with iter8 report
uses: marocchino/sticky-pull-request-comment@efaaab3fd41a9c3de579aba759d2552635e590fd # v2.8.0
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2.9.0
if: ${{ github.event_name == 'pull_request' }}
with:
append: true
path: iter8-output.md

- name: Upload report
if: always()
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: iter8-report.html
path: |
Expand All @@ -313,14 +313,14 @@ jobs:
- name: Upload cluster dump
if: always()
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: kind-cluster-dump.txt
path: |
kind-cluster-dump.txt
lint:
uses: miracum/.github/.github/workflows/standard-lint.yaml@402d475fc7f49888381ea1090ddc2004ac8a8e59 # v1.5.3
uses: miracum/.github/.github/workflows/standard-lint.yaml@d312bc78e5a4ab6bafc71979f80962177abc6336 # v1.5.7
permissions:
contents: read
pull-requests: write
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nightly-chaos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3

- name: Install Task
uses: arduino/setup-task@e26d8975574116b0097a1161e0fe16ba75d84c1c # v1.0.3
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Upload cluster dump
if: always()
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: kind-cluster-dump.txt
path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/schedule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions: read-all

jobs:
schedule:
uses: miracum/.github/.github/workflows/standard-schedule.yaml@402d475fc7f49888381ea1090ddc2004ac8a8e59 # v1.5.3
uses: miracum/.github/.github/workflows/standard-schedule.yaml@d312bc78e5a4ab6bafc71979f80962177abc6336 # v1.5.7
permissions:
contents: read
issues: write
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/scorecards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

steps:
- name: "Checkout code"
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false

Expand All @@ -60,14 +60,14 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@8b7fcbfac2aae0e6c24d9f9ebd5830b1290b18e4 # v2.23.0
uses: github/codeql-action/upload-sarif@2f93e4319b2f04a2efc38fa7f78bd681bc3f7b2f # v2.23.2
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion src/Vfps.Benchmarks/PseudonymGeneratorBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ public string HexEncodedSha256HashGenerator() =>
sha256HashGenerator.GeneratePseudonym("test", 64);

[Benchmark]
public string Uuid4HashGenerator() => uuid4Generator.GeneratePseudonym("test", 36);
public string Uuid4Generator() => uuid4Generator.GeneratePseudonym("test", 36);
}
8 changes: 3 additions & 5 deletions src/Vfps.StressTests/StressTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,9 @@ public void RunStressSimulation()
}
catch (RpcException exc) when (exc.StatusCode == StatusCode.AlreadyExists)
{
context
.Logger
.Warning(
$"Namespace {namespaceRequest.Name} already exists. Continuing anyway."
);
context.Logger.Warning(
$"Namespace {namespaceRequest.Name} already exists. Continuing anyway."
);
}
})
.WithWarmUpDuration(TimeSpan.FromSeconds(5))
Expand Down
12 changes: 3 additions & 9 deletions src/Vfps.Tests/ControllerTests/FhirControllerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ public async Task CreatePseudonym_WithEmptyBody_ShouldReturnErrorOutcome()
response
.Should()
.BeOfType<BadRequestObjectResult>()
.Which
.Value
.Should()
.Which.Value.Should()
.BeOfType<OperationOutcome>();
}

Expand All @@ -46,9 +44,7 @@ public async Task CreatePseudonym_WithNull_ShouldReturnErrorOutcome()
response
.Should()
.BeOfType<BadRequestObjectResult>()
.Which
.Value
.Should()
.Which.Value.Should()
.BeOfType<OperationOutcome>();
}

Expand Down Expand Up @@ -77,9 +73,7 @@ public async Task CreatePseudonym_WithExistingNamespaceRequested_ShouldSucceed()
var parameterResponse = response
.Should()
.BeOfType<OkObjectResult>()
.Which
.Value
.Should()
.Which.Value.Should()
.BeOfType<Parameters>()
.Which;

Expand Down
9 changes: 3 additions & 6 deletions src/Vfps.Tests/ServiceTests/NamespaceServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ public async Task Delete_WithNamespaceContainingPseudonyms_ShouldDeleteNamespace
}

var pseudonymCount = await InMemoryPseudonymContext
.Pseudonyms
.AsNoTracking()
.Pseudonyms.AsNoTracking()
.Where(p => p.NamespaceName == createRequest.Name)
.CountAsync();

Expand All @@ -156,15 +155,13 @@ public async Task Delete_WithNamespaceContainingPseudonyms_ShouldDeleteNamespace
await sut.Delete(deleteRequest, TestServerCallContext.Create());

InMemoryPseudonymContext
.Namespaces
.AsNoTracking()
.Namespaces.AsNoTracking()
.Where(n => n.Name == deleteRequest.Name)
.Should()
.BeEmpty();

pseudonymCount = await InMemoryPseudonymContext
.Pseudonyms
.AsNoTracking()
.Pseudonyms.AsNoTracking()
.Where(p => p.NamespaceName == createRequest.Name)
.CountAsync();

Expand Down
20 changes: 7 additions & 13 deletions src/Vfps.Tests/ServiceTests/PseudonymServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@ public async Task Create_ShouldSaveNewPseudonym()
response.Pseudonym.PseudonymValue.Should().NotBeNull(request.OriginalValue);

InMemoryPseudonymContext
.Pseudonyms
.Should()
.Contain(
p =>
p.OriginalValue == request.OriginalValue && p.NamespaceName == request.Namespace
.Pseudonyms.Should()
.Contain(p =>
p.OriginalValue == request.OriginalValue && p.NamespaceName == request.Namespace
);
}

Expand Down Expand Up @@ -101,24 +99,21 @@ public async Task Create_CalledMultipleTimesWithTheSameOriginalValue_ShouldOnlyS
var response = await sut.Create(request, TestServerCallContext.Create());
var firstCreatedPseudonym = response.Pseudonym.PseudonymValue;
InMemoryPseudonymContext
.Pseudonyms
.Where(p => p.NamespaceName == request.Namespace)
.Pseudonyms.Where(p => p.NamespaceName == request.Namespace)
.Should()
.HaveCount(1);

response = await sut.Create(request, TestServerCallContext.Create());
response.Pseudonym.PseudonymValue.Should().Be(firstCreatedPseudonym);
InMemoryPseudonymContext
.Pseudonyms
.Where(p => p.NamespaceName == request.Namespace)
.Pseudonyms.Where(p => p.NamespaceName == request.Namespace)
.Should()
.HaveCount(1);

response = await sut.Create(request, TestServerCallContext.Create());
response.Pseudonym.PseudonymValue.Should().Be(firstCreatedPseudonym);
InMemoryPseudonymContext
.Pseudonyms
.Where(p => p.NamespaceName == request.Namespace)
.Pseudonyms.Where(p => p.NamespaceName == request.Namespace)
.Should()
.HaveCount(1);
}
Expand Down Expand Up @@ -256,8 +251,7 @@ public async Task List_WithMoreItemsThanPageSize_ShouldReturnAllPseudonymsViaPag
}

InMemoryPseudonymContext
.Pseudonyms
.Where(p => p.NamespaceName == namespaceName)
.Pseudonyms.Where(p => p.NamespaceName == namespaceName)
.Count()
.Should()
.Be(pseudonymsToCreateCount);
Expand Down
Loading

0 comments on commit e80ab02

Please sign in to comment.