Skip to content

Commit 4eb390a

Browse files
authored
ansible galaxy importer (#85)
add galaxy importer workflow - this workflow validates that collection tarball could be imported to galaxy
1 parent 1c189df commit 4eb390a

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/galaxy_importer.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: galaxy importer
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
galaxy:
8+
runs-on: ubuntu-latest
9+
name: importer
10+
env:
11+
source_path: "./source"
12+
importer_path: "./importer"
13+
steps:
14+
- name: checkout collection
15+
uses: ansible-network/github_actions/.github/actions/checkout_dependency@main
16+
with:
17+
path: ${{ env.source_path }}
18+
ref: ${{ github.event.pull_request.head.sha }}
19+
20+
- name: Read collection metadata from galaxy.yml
21+
id: identify
22+
uses: ansible-network/github_actions/.github/actions/identify_collection@main
23+
with:
24+
source_path: ${{ env.source_path }}
25+
26+
- name: Build collection
27+
run: ansible-galaxy collection build -vvv
28+
shell: bash
29+
working-directory: ${{ env.source_path }}
30+
31+
- name: checkout ansible-network/releases
32+
uses: ansible-network/github_actions/.github/actions/checkout_dependency@main
33+
with:
34+
repository: ansible-network/releases
35+
path: ${{ env.importer_path }}
36+
ref: master
37+
38+
- name: Create tox environment
39+
uses: ansible-network/github_actions/.github/actions/tox@main
40+
with:
41+
path: ${{ env.importer_path }}
42+
tox_envlist: venv
43+
tox_extra_args: "-vv --notest"
44+
45+
- name: Confirm collection can be imported into galaxy
46+
run: |
47+
source .tox/venv/bin/activate
48+
./tools/validate-collection.sh ${COLLECTION_TARBALL}
49+
shell: bash
50+
env:
51+
COLLECTION_TARBALL: "${{ github.workspace }}/${{ env.source_path }}/${{ steps.identify.outputs.tar_file }}"
52+
GALAXY_IMPORTER_CONFIG: "${{ github.workspace }}/${{ env.source_path }}/tests/galaxy-importer.cfg"
53+
working-directory: ${{ env.importer_path }}

0 commit comments

Comments
 (0)