Skip to content

Commit

Permalink
Add basic tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Jan 21, 2024
1 parent 49327a2 commit 3a46772
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

name: Action testing

'on':
push:
branches: [main]
pull_request:
branches: [main]
# Run once per week (Friday at 07:00 UTC)
schedule:
- cron: '0 7 * * 5'

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v4
with:
python-version: 3.12

- name: Install ansible-core
run: pip install ansible-core

- name: Build collection
run: ansible-galaxy collection build
working-directory: tests/foo.bar

- name: Run action
id: action
uses: ./
with:
artifact-path: tests/foo.bar/foo-bar-1.2.3.tar.gz
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
# GitHub Action for testing importing an Ansible collection with the Galaxy importer

[![Linting](https://github.com/ansible-community/github-action-test-galaxy-import/actions/workflows/linting.yml/badge.svg)](https://github.com/ansible-community/github-action-test-galaxy-import/actions/workflows/linting.yml)
[![Tests](https://github.com/ansible-community/github-action-test-galaxy-import/actions/workflows/tests.yml/badge.svg)](https://github.com/ansible-community/github-action-test-galaxy-import/actions/workflows/tests.yml)
[![REUSE](https://github.com/ansible-community/github-action-test-galaxy-import/actions/workflows/reuse.yml/badge.svg)](https://github.com/ansible-community/github-action-test-galaxy-import/actions/workflows/reuse.yml)

A composite GitHub Action that allows to test importing a built Ansible collection with the [Galaxy importer](https://github.com/ansible/galaxy-importer) in GitHub Actions CI/CD workflows.
Expand Down
9 changes: 9 additions & 0 deletions tests/foo.bar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!--
Copyright (c) Ansible Project
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
SPDX-License-Identifier: GPL-3.0-or-later
-->

# Hello

Nothing to see.
15 changes: 15 additions & 0 deletions tests/foo.bar/galaxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

namespace: foo
name: bar
version: 1.2.3
readme: README.md
authors:
- Nobody
license:
- GPL-3.0-or-later
tags:
- test

0 comments on commit 3a46772

Please sign in to comment.