Skip to content

Commit

Permalink
Add workflow to test Meltano add/install for changed plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
ReubenFrankel committed Mar 31, 2024
1 parent 7c02272 commit 91a12cd
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/test_meltano_add_install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Test Meltano add/install

on:
pull_request_target:
types: [opened, synchronize, reopened]
paths: [_data/meltano/*/*/*.yml]

jobs:
get_changed-plugins:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.changed_plugins.outputs.all_changed_files }}
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Get changed plugins
id: changed_plugins
uses: tj-actions/changed-files@v43.0.1
with:
sha: ${{ github.event.pull_request.head.sha }}
files: _data/meltano/*/*/*.yml
matrix: true

test:
runs-on: ubuntu-latest
needs: get_changed_plugins
strategy:
matrix:
file: ${{ fromJSON(needs.get_changed_plugins.outputs.matrix) }}
fail-fast: false
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9

- name: Install Meltano
run: pipx install meltano

- name: Setup test project
run: meltano init --no_usage_stats test-project

- name: Test add
working-directory: test-project
run: |
ref=https://raw.githubusercontent.com/meltano/hub/${{ github.event.pull_request.head.sha }}/${{ matrix.file }}
type=$(basename $(dirname $(dirname ${{ matrix.file }})))
name=$(basename $(dirname ${{ matrix.file }}))
meltano add --no-install --from-ref $ref $type $name
- name: Test install
working-directory: test-project
run: meltano install

0 comments on commit 91a12cd

Please sign in to comment.