ovh-dns-update/.forgejo/workflows/pr.yml
oliverpool 86ff171ddd add PR testing (#1)
Reviewed-on: https://code.forgejo.org/actions/ovh-dns-update/pulls/1
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2023-08-20 06:44:27 +00:00

37 lines
1.1 KiB
YAML

name: pr
on:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: ">=1.21"
check-latest: true
- name: run the fake API server
id: test
run: |
touch delete_me_when_ready
# keep server running in the background
ACTION_TESTING=1 go test . &
# wait for the OVH_ENDPOINT output to be written (inotifywait not available)
tail --follow=name delete_me_when_ready || echo "test server is listening"
- name: update the record
uses: ./
with:
subdomain: _release
domain: example.org
record-id: 12345
value: v=v1.42
ovh-endpoint: ${{ steps.test.outputs.OVH_ENDPOINT }}
ovh-app-key: APP_KEY
ovh-app-secret: APP_SECRET
ovh-consumer-key: CON_KEY
- name: check updated record value
run: |
cat dns.txt && echo
grep --quiet "v=v1.42" dns.txt