Skip to content

Matcher: Status API #1234

Matcher: Status API

Matcher: Status API #1234

Workflow file for this run

name: "Matcher"
on:
pull_request:
branches: [main, v3]
push:
branches: [main, v3]
release:
types: [published]
defaults:
run:
working-directory: ./matcher
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
matcher: ${{ steps.filter.outputs.matcher }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
matcher:
- 'matcher/**'
- '.github/workflows/matcher.yml'
- '.github/actions/cache-matcher/**'
- '.github/actions/dockerize/**'
Typecheck:
needs: changes
if: ${{ needs.changes.outputs.matcher == 'true' && github.event_name == 'pull_request' }}
container: python:3.13-alpine
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Restore Dependencies
uses: ./.github/actions/cache-matcher
- uses: jakebailey/pyright-action@v2
with:
working-directory: "./matcher/matcher"
Lint:
if: ${{ needs.changes.outputs.matcher == 'true' && github.event_name == 'pull_request' }}
container: python:3.13-alpine
runs-on: ubuntu-latest
needs: [Typecheck]
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Restore Dependencies
uses: ./.github/actions/cache-matcher
- run: pip install ruff
- run: ruff check matcher
Tests:
runs-on: ubuntu-latest
needs: [Typecheck]
container: python:3.13-alpine
if: ${{ needs.changes.outputs.matcher == 'true' && always() }}
env:
GENIUS_ACCESS_TOKEN: "${{ secrets.GENIUS_ACCESS_TOKEN }}"
DISCOGS_ACCESS_TOKEN: "${{ secrets.DISCOGS_ACCESS_TOKEN }}"
CI: "1"
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Restore Dependencies
uses: ./.github/actions/cache-matcher
- run: python3 -m tests
Dockerize:
runs-on: ubuntu-latest
needs: changes
if: ${{ github.event_name == 'release' || (needs.changes.outputs.matcher == 'true' && (github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main'))) }}
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v3
- uses: ./.github/actions/dockerize
with:
docker-username: ${{ secrets.DOCKERHUB_USERNAME }}
docker-token: ${{ secrets.DOCKERHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
context: ./matcher
image-suffix: matcher
publish: ${{ github.event_name == 'release' || (needs.changes.outputs.matcher == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main') }}