55 pull_request :
66 branches :
77 - ' **'
8- types : [ opened, reopened, synchronize ]
98 workflow_call :
109 inputs :
1110 platforms :
3837jobs :
3938
4039 tests :
41- name : Tests (${{ matrix.name }})
40+ name : Tests
4241 runs-on : ubuntu-latest
43- strategy :
44- fail-fast : false
45- matrix :
46- include :
47- - name : common-unit
48- project : Common.Tests/Common.Tests.csproj
49- - name : api-integration
50- project : API.IntegrationTests/API.IntegrationTests.csproj
5142
5243 steps :
5344 - name : Checkout
54- uses : actions/checkout@v6
45+ uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
5546
56- - uses : actions/setup-dotnet@v5
47+ - uses : actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
5748 with :
5849 dotnet-version : ' ${{ env.DOTNET_VERSION }}'
5950
60- - name : Run ${{ matrix.name }} tests
51+ - name : Run tests
6152 run : |
6253 set -euo pipefail
63- dotnet test -c Release --project ${{ matrix.project }}
54+ dotnet test -c Release --solution OpenShockBackend.slnx \
55+ --results-directory "artifacts/test-results" \
56+ -- \
57+ --report-trx \
58+ --report-trx-filename test-results.trx
59+
60+ - name : Upload test artifacts
61+ if : always()
62+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
63+ with :
64+ name : test-results
65+ path : artifacts/test-results
66+ if-no-files-found : warn
6467
6568 build :
6669 name : Build (${{ matrix.image }})
@@ -78,13 +81,13 @@ jobs:
7881
7982 steps :
8083 - name : Checkout
81- uses : actions/checkout@v6
84+ uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
8285
8386 - name : Set up Docker Buildx
84- uses : docker/setup-buildx-action@v3
87+ uses : docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
8588
8689 - name : Log in to Container Registry
87- uses : docker/login-action@v3
90+ uses : docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
8891 with :
8992 registry : ${{ env.REGISTRY }}
9093 username : ${{ github.actor }}
@@ -101,7 +104,7 @@ jobs:
101104
102105 promote-image :
103106 name : Promote Image (${{ matrix.image }})
104- needs : [build, tests ]
107+ needs : [build]
105108 runs-on : ubuntu-latest
106109 if : ${{ inputs.push || (github.ref_protected && github.event_name != 'pull_request') }}
107110 strategy :
@@ -114,10 +117,10 @@ jobs:
114117
115118 steps :
116119 - name : Checkout
117- uses : actions/checkout@v6
120+ uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
118121
119122 - name : Log in to Container Registry
120- uses : docker/login-action@v3
123+ uses : docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
121124 with :
122125 registry : ${{ env.REGISTRY }}
123126 username : ${{ github.actor }}
@@ -137,15 +140,13 @@ jobs:
137140 environment : production
138141 steps :
139142 - name : Send repository dispatch
140- uses : peter-evans/ repository-dispatch@v4
143+ uses : OpenShock/actions/ repository-dispatch@21ca2d511bca92cf24fb502fa302f82700822584 # v1.1.1
141144 with :
142- token : ${{ secrets.GITOPS_PAT }}
143- repository : openshock/kubernetes-cluster-gitops
145+ repo : openshock/kubernetes-cluster-gitops
144146 event-type : update-backend-prod
145147 client-payload : |
146- {
147- "tag": "${{ inputs.tag-prefix || 'rn' }}-${{ github.run_number }}-a${{ github.run_attempt }}"
148- }
148+ {"tag": "${{ inputs.tag-prefix || 'rn' }}-${{ github.run_number }}-a${{ github.run_attempt }}"}
149+ token : ${{ secrets.GITOPS_PAT }}
149150
150151 deploy-staging :
151152 runs-on : ubuntu-latest
@@ -155,15 +156,13 @@ jobs:
155156
156157 steps :
157158 - name : Send repository dispatch
158- uses : peter-evans/ repository-dispatch@v4
159+ uses : OpenShock/actions/ repository-dispatch@21ca2d511bca92cf24fb502fa302f82700822584 # v1.1.1
159160 with :
160- token : ${{ secrets.GITOPS_PAT }}
161- repository : openshock/kubernetes-cluster-gitops
161+ repo : openshock/kubernetes-cluster-gitops
162162 event-type : update-backend-staging
163163 client-payload : |
164- {
165- "tag": "${{ inputs.tag-prefix || 'rn' }}-${{ github.run_number }}-a${{ github.run_attempt }}"
166- }
164+ {"tag": "${{ inputs.tag-prefix || 'rn' }}-${{ github.run_number }}-a${{ github.run_attempt }}"}
165+ token : ${{ secrets.GITOPS_PAT }}
167166
168167 deploy-dev :
169168 runs-on : ubuntu-latest
@@ -172,12 +171,12 @@ jobs:
172171 environment : development
173172
174173 steps :
175- - uses : actions/checkout@v6
174+ - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
176175 with :
177176 sparse-checkout : |
178177 .github
179178
180179 - uses : ./.github/actions/watchtower-update
181180 with :
182181 url : ${{ vars.WATCHTOWER_URL }}
183- token : ${{ secrets.WATCHTOWER_TOKEN }}
182+ token : ${{ secrets.WATCHTOWER_TOKEN }}
0 commit comments