Skip to content

Commit

Permalink
Merge pull request #41 from achmadhadikurnia/test/update-tests
Browse files Browse the repository at this point in the history
test(action): update run-tests.yml
  • Loading branch information
achmadhadikurnia authored Jul 4, 2024
2 parents 2330d25 + daada07 commit 6d79fab
Showing 1 changed file with 62 additions and 23 deletions.
85 changes: 62 additions & 23 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,29 +57,68 @@ jobs:
- name: Copy phpunit.xml.dist to phpunit.xml
run: cp phpunit.xml.dist phpunit.xml

- name: Add secrets to phpunit.xml
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
sed `-i 's/{{SIASN_MODE}}/${{ secrets.SIASN_MODE }}/g' phpunit.xml
sed -i 's/{{SIASN_APIM_USERNAME}}/${{ secrets.SIASN_APIM_USERNAME }}/g' phpunit.xml
sed -i 's/{{SIASN_APIM_PASSWORD}}/${{ secrets.SIASN_APIM_PASSWORD }}/g' phpunit.xml
sed -i 's/{{SIASN_SSO_CLIENT_ID}}/${{ secrets.SIASN_SSO_CLIENT_ID }}/g' phpunit.xml
sed -i 's/{{SIASN_SSO_USERNAME}}/${{ secrets.SIASN_SSO_USERNAME }}/g' phpunit.xml
sed -i 's/{{SIASN_SSO_PASSWORD}}/${{ secrets.SIASN_SSO_PASSWORD }}/g' phpunit.xml
sed -i 's/{{SIASN_CONST_INSTANSI_ID}}/${{ secrets.SIASN_CONST_INSTANSI_ID }}/g' phpunit.xml
sed -i 's/{{SIASN_CONST_SATUAN_KERJA_ID}}/${{ secrets.SIASN_CONST_SATUAN_KERJA_ID }}/g' phpunit.xml
sed -i '`s/{{SIASN_CONST_PNS_ORANG_ID}}/${{ secrets.SIASN_CONST_PNS_ORANG_ID }}/g' phpunit.xml
else
sed -i 's@{{SIASN_MODE}}@${{ secrets.SIASN_MODE }}@g' phpunit.xml
sed -i 's@{{SIASN_APIM_USERNAME}}@${{ secrets.SIASN_APIM_USERNAME }}@g' phpunit.xml
sed -i 's@{{SIASN_APIM_PASSWORD}}@${{ secrets.SIASN_APIM_PASSWORD }}@g' phpunit.xml
sed -i 's@{{SIASN_SSO_CLIENT_ID}}@${{ secrets.SIASN_SSO_CLIENT_ID }}@g' phpunit.xml
sed -i 's@{{SIASN_SSO_USERNAME}}@${{ secrets.SIASN_SSO_USERNAME }}@g' phpunit.xml
sed -i 's@{{SIASN_SSO_PASSWORD}}@${{ secrets.SIASN_SSO_PASSWORD }}@g' phpunit.xml
sed -i 's@{{SIASN_CONST_INSTANSI_ID}}@${{ secrets.SIASN_CONST_INSTANSI_ID }}@g' phpunit.xml
sed -i 's@{{SIASN_CONST_SATUAN_KERJA_ID}}@${{ secrets.SIASN_CONST_SATUAN_KERJA_ID }}@g' phpunit.xml
sed -i 's@{{SIASN_CONST_PNS_ORANG_ID}}@${{ secrets.SIASN_CONST_PNS_ORANG_ID }}@g' phpunit.xml
fi
- name: Replace SIASN_MODE in phpunit.xml
uses: jacobtomlinson/gha-find-replace@v3
with:
files: 'phpunit.xml'
find: '{{SIASN_MODE}}'
replace: ${{ secrets.SIASN_MODE }}

- name: Replace SIASN_APIM_USERNAME in phpunit.xml
uses: jacobtomlinson/gha-find-replace@v3
with:
files: 'phpunit.xml'
find: '{{SIASN_APIM_USERNAME}}'
replace: ${{ secrets.SIASN_APIM_USERNAME }}

- name: Replace SIASN_APIM_PASSWORD in phpunit.xml
uses: jacobtomlinson/gha-find-replace@v3
with:
files: 'phpunit.xml'
find: '{{SIASN_APIM_PASSWORD}}'
replace: ${{ secrets.SIASN_APIM_PASSWORD }}

- name: Replace SIASN_SSO_CLIENT_ID in phpunit.xml
uses: jacobtomlinson/gha-find-replace@v3
with:
files: 'phpunit.xml'
find: '{{SIASN_SSO_CLIENT_ID}}'
replace: ${{ secrets.SIASN_SSO_CLIENT_ID }}

- name: Replace SIASN_SSO_USERNAME in phpunit.xml
uses: jacobtomlinson/gha-find-replace@v3
with:
files: 'phpunit.xml'
find: '{{SIASN_SSO_USERNAME}}'
replace: ${{ secrets.SIASN_SSO_USERNAME }}

- name: Replace SIASN_SSO_PASSWORD in phpunit.xml
uses: jacobtomlinson/gha-find-replace@v3
with:
files: 'phpunit.xml'
find: '{{SIASN_SSO_PASSWORD}}'
replace: ${{ secrets.SIASN_SSO_PASSWORD }}

- name: Replace SIASN_CONST_INSTANSI_ID in phpunit.xml
uses: jacobtomlinson/gha-find-replace@v3
with:
files: 'phpunit.xml'
find: '{{SIASN_CONST_INSTANSI_ID}}'
replace: ${{ secrets.SIASN_CONST_INSTANSI_ID }}

- name: Replace SIASN_CONST_SATUAN_KERJA_ID in phpunit.xml
uses: jacobtomlinson/gha-find-replace@v3
with:
files: 'phpunit.xml'
find: '{{SIASN_CONST_SATUAN_KERJA_ID}}'
replace: ${{ secrets.SIASN_CONST_SATUAN_KERJA_ID }}

- name: Replace SIASN_CONST_PNS_ORANG_ID in phpunit.xml
uses: jacobtomlinson/gha-find-replace@v3
with:
files: 'phpunit.xml'
find: '{{SIASN_CONST_PNS_ORANG_ID}}'
replace: ${{ secrets.SIASN_CONST_PNS_ORANG_ID }}

- name: Execute tests
run: vendor/bin/pest --ci
Expand Down

0 comments on commit 6d79fab

Please sign in to comment.