2020-12-08 09:38:52 +01:00
|
|
|
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
|
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
|
|
|
|
2020-12-08 09:46:39 +01:00
|
|
|
name: Build and Test
|
2020-12-08 09:38:52 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
2024-09-27 00:42:05 +02:00
|
|
|
runs-on: ubuntu-24.04
|
2020-12-08 09:38:52 +01:00
|
|
|
|
|
|
|
steps:
|
2023-09-04 16:26:25 +02:00
|
|
|
- uses: actions/checkout@v4
|
2024-08-21 17:56:09 +02:00
|
|
|
- name: Install rye
|
|
|
|
uses: eifinger/setup-rye@v4
|
2020-12-08 09:38:52 +01:00
|
|
|
with:
|
2024-08-21 17:56:09 +02:00
|
|
|
version: 'latest'
|
|
|
|
- run: rye sync
|
|
|
|
- name: Lint
|
2020-12-08 09:38:52 +01:00
|
|
|
run: |
|
|
|
|
# stop the build if there are Python syntax errors or undefined names
|
2024-08-21 17:56:09 +02:00
|
|
|
rye lint
|
2020-12-08 09:38:52 +01:00
|
|
|
- name: Test with pytest
|
2024-08-21 17:56:09 +02:00
|
|
|
run: rye test
|
2020-12-14 22:47:09 +01:00
|
|
|
- name: Test CLI
|
|
|
|
run: |
|
2021-12-24 13:47:25 +01:00
|
|
|
# Basic test
|
2024-08-21 17:56:09 +02:00
|
|
|
rye run csv-metadata-quality -i data/test.csv -o /tmp/test.csv
|
2021-12-24 13:47:25 +01:00
|
|
|
# Test with unsafe fixes
|
2024-08-21 17:56:09 +02:00
|
|
|
rye run csv-metadata-quality -i data/test.csv -o /tmp/test.csv -u
|
2021-12-24 13:47:25 +01:00
|
|
|
# Test with experimental checks
|
2024-08-21 17:56:09 +02:00
|
|
|
rye run csv-metadata-quality -i data/test.csv -o /tmp/test.csv -e
|
2021-12-24 13:47:25 +01:00
|
|
|
# Test with AGROVOC validation
|
2024-08-21 17:56:09 +02:00
|
|
|
rye run csv-metadata-quality -i data/test.csv -o /tmp/test.csv --agrovoc-fields dcterms.subject
|
2021-12-24 13:47:25 +01:00
|
|
|
# Test with AGROVOC validation (and dropping invalid)
|
2024-08-21 17:56:09 +02:00
|
|
|
rye run csv-metadata-quality -i data/test.csv -o /tmp/test.csv --agrovoc-fields dcterms.subject -d
|