Skip to content

API-IMPORT-ORCID-BATCH-01: Add exact batch contributor lookup by ORCID #1905

API-IMPORT-ORCID-BATCH-01: Add exact batch contributor lookup by ORCID

API-IMPORT-ORCID-BATCH-01: Add exact batch contributor lookup by ORCID #1905

name: build-test-and-check
on:
push:
branches:
- master
- develop
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
THOTH_EXPORT_API: https://export.thoth.pub
TEST_DATABASE_URL: postgres://thoth:thoth@localhost:5432/thoth_test
TEST_REDIS_URL: redis://localhost:6379
jobs:
classify:
permissions:
contents: read
runs-on: ubuntu-latest
outputs:
run_build: ${{ steps.classify.outputs.run_build }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Classify CI changes
id: classify
run: python3 .github/scripts/classify_ci_changes.py
build:
needs: classify
if: >-
${{
always() &&
!cancelled() &&
(
needs.classify.result != 'success' ||
needs.classify.outputs.run_build == 'true'
)
}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build binary
run: cargo build -vv
test:
needs: classify
if: >-
${{
always() &&
!cancelled() &&
(
needs.classify.result != 'success' ||
needs.classify.outputs.run_build == 'true'
)
}}
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17
env:
POSTGRES_DB: thoth_test
POSTGRES_USER: thoth
POSTGRES_PASSWORD: thoth
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:alpine
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run tests
run: cargo test --workspace -vv
lint:
needs: classify
if: >-
${{
always() &&
!cancelled() &&
(
needs.classify.result != 'success' ||
needs.classify.outputs.run_build == 'true'
)
}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run linting
run: cargo clippy --all --all-targets --all-features -- -D warnings
format_check:
needs: classify
if: >-
${{
always() &&
!cancelled() &&
(
needs.classify.result != 'success' ||
needs.classify.outputs.run_build == 'true'
)
}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run format
run: cargo fmt --all -- --check