Update OECD DAC Codelists with 2023-08-29 changes #63
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
workflow_dispatch: | |
push: | |
paths-ignore: | |
- "**/README.rst" | |
- "**/dependabot.yml" | |
branches: [master] | |
pull_request: | |
paths-ignore: | |
- "**/README.rst" | |
- "**/dependabot.yml" | |
branches: [master] | |
concurrency: CI | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Checkout Schemas repo | |
uses: actions/checkout@v4 | |
with: | |
repository: IATI/IATI-Codelists | |
ref: version-2.03 | |
path: IATI-Codelists | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
sudo apt-get -y install libxml2-dev libxslt-dev libxslt1-dev python3-dev python3-lxml libxml2-utils | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install -r requirements.txt | |
- name: flake8 lint | |
run: flake8 --exclude=pyenv*,IATI-Codelists --ignore E501 | |
- name: xml lint | |
run: xmllint --schema IATI-Codelists/codelist.xsd --noout xml/* | |
update-validator-codelists: | |
needs: build | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' && github.actor != 'dependabot[bot]' }} | |
strategy: | |
fail-fast: true | |
matrix: | |
version: [ 2.01, 2.02, 2.03 ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: 'Trigger update of Validator Codelists repository for version-${{ matrix.version }}' | |
run: | | |
HTTP_CODE=$(curl --write-out "%{http_code}\n" \ | |
-H 'Accept: application/vnd.github.everest-preview+json' \ | |
-H 'Authorization: Bearer ${{ secrets.IATI_BOT_PAT }}' \ | |
-X POST https://api.github.com/repos/IATI/IATI-Validator-Codelists/actions/workflows/dispatch-CI.yaml/dispatches \ | |
--data '{"ref": "version-${{ matrix.version }}", "inputs": { "repo": "'"$GITHUB_REPOSITORY"'", "sha": "'"$GITHUB_SHA"'"}}' \ | |
--output curl_out.txt \ | |
--silent ) | |
echo $HTTP_CODE | |
if [[ $HTTP_CODE != '204' ]] ; then | |
echo "Reponse is not 204, check error logs" | |
cat curl_out.txt | |
exit 1 | |
fi | |
call-update-dss-filters: | |
needs: build | |
if: ${{ github.event_name == 'push' && github.actor != 'dependabot[bot]' }} | |
uses: IATI/.github/.github/workflows/trigger_dss_filters.yaml@main | |
secrets: | |
IATI_BOT_PAT: ${{ secrets.IATI_BOT_PAT }} | |
automerge: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
contents: write | |
steps: | |
- uses: fastify/[email protected] | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} |