-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (116 loc) · 3.88 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: ci
on:
push:
branches: [master]
release:
types: [created]
pull_request:
branches: [master]
permissions:
contents: read
jobs:
build:
uses: chgl/.github/.github/workflows/standard-build.yaml@a70808072e4df6003d21ea0255938271aa6b535d # v1.10.5
permissions:
contents: write
id-token: write
packages: write
pull-requests: write
actions: read
security-events: write
with:
enable-build-test-layer: true
enable-upload-test-image: false
platforms: |
linux/amd64
linux/arm64
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
lint:
uses: chgl/.github/.github/workflows/standard-lint.yaml@a70808072e4df6003d21ea0255938271aa6b535d # v1.10.5
permissions:
contents: read
pull-requests: write
issues: write
security-events: write
actions: read
with:
codeql-languages: '["csharp"]'
enable-codeql: true
enable-verify-base-image-signature: false
enable-validate-gradle-wrapper: false
dotnet-version: 9.0.x
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
test:
name: test
needs:
- build
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
# <https://docs.docker.com/storage/containerd/>
# via <https://github.com/docker/setup-buildx-action/issues/257>
- name: Set up containerd image store
shell: bash
run: |
[ -f /etc/docker/daemon.json ] || echo "{}" | sudo tee /etc/docker/daemon.json
jq '. | .+{"features": {"containerd-snapshotter": true}}' /etc/docker/daemon.json > /tmp/docker-daemon-with-containerd.json
sudo mv /tmp/docker-daemon-with-containerd.json /etc/docker/daemon.json
cat /etc/docker/daemon.json
sudo systemctl restart docker
docker info -f '{{ .DriverStatus }}'
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Download image
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
if: ${{ github.event_name == 'pull_request' }}
with:
name: ${{ needs.build.outputs.image-slug }}
path: /tmp
- name: load image
if: ${{ github.event_name == 'pull_request' }}
run: |
docker load --input /tmp/image.tar
- name: Install .NET
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0
with:
dotnet-version: "9.x"
- name: Run E2E tests with newly built container image
env:
FHIR_SERVER_EXPORTER_E2E_TEST_IMAGE: ${{ fromJson(needs.build.outputs.image-meta-json).tags[0] }}
run: |
dotnet restore --locked-mode src/FhirServerExporter.Tests.E2E/
dotnet test src/FhirServerExporter.Tests.E2E/
release:
uses: chgl/.github/.github/workflows/standard-release.yaml@a70808072e4df6003d21ea0255938271aa6b535d # v1.10.5
needs:
- build
- test
permissions:
contents: write
pull-requests: write
issues: write
secrets:
semantic-release-token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
copy-image-to-dockerhub:
name: copy ghcr.io image to DockerHub
if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-24.04
needs:
- build
steps:
- uses: imjasonh/setup-crane@31b88efe9de28ae0ffa220711af4b60be9435f6e # v0.4
- name: Login to DockerHub
env:
DOCKERHUB_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"
run: |
echo "${DOCKERHUB_TOKEN}" | crane auth login docker.io --username chgl --password-stdin
- name: Copy all tags
env:
TAGS: ${{ needs.build.outputs.image-tags }}
run: |
echo "${TAGS}" | while read -r tag; do crane copy "$tag" "${tag/ghcr.io/docker.io}"; done