Skip to content

Sync tests

Sync tests #358

Workflow file for this run

# Run tests for awk or test files modified in this PR.
name: AWK / pr
on: pull_request
jobs:
ci:
runs-on: ubuntu-24.04
steps:
- name: Checkout PR
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- name: Install software
run: sudo apt update && sudo apt -y install gawk bats
# bats v1.10.0 -- https://launchpad.net/ubuntu/noble/+source/bats
# gawk v5.2.1 -- https://launchpad.net/ubuntu/noble/+source/gawk
- name: Run tests for changed/added exercises
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pr_endpoint=$(jq -r '"repos/\(.repository.full_name)/pulls/\(.pull_request.number)"' "$GITHUB_EVENT_PATH")
gh api "$pr_endpoint/files" --paginate --jq '
.[] |
select(.status == "added" or .status == "modified" or .status == "renamed") |
select(.filename | match("\\.(awk|bats|bash|md)$")) |
.filename
' | xargs -r bash bin/pr