diff --git a/.github/workflows/add-issue-to-project.yml b/.github/workflows/add-issue-to-project.yml new file mode 100644 index 0000000..1d22782 --- /dev/null +++ b/.github/workflows/add-issue-to-project.yml @@ -0,0 +1,15 @@ +name: Add issue to project + +on: + issues: + types: + - opened + +jobs: + add-issue-to-project: + runs-on: ubuntu-latest + steps: + - uses: UCL-MIRSG/.github/actions/add-to-project@v0.25.0 + with: + app-id: ${{ secrets.APP_ID }} + app-pem: ${{ secrets.APP_PEM }} diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index f79f5bd..37b3334 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -1,40 +1,16 @@ ---- -name: Pre-commit checks +name: Linting + on: - pull_request: push: branches: - - main + - main + - "renovate/**" + pull_request: jobs: - build: + linting: runs-on: ubuntu-latest steps: - - name: Checkout source - uses: actions/checkout@v4 - - - name: Set up python - uses: actions/setup-python@v4 - with: - python-version: 3.9 - - - name: Set PY - run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - - - name: Cache pre-commit install - uses: actions/cache@v3 + - uses: UCL-MIRSG/.github/actions/linting@v0.25.0 with: - path: | - ${{ env.pythonLocation }} - ~/.cache/pre-commit - key: | - pre-commit-${{ env.PY }}-${{ hashFiles('.pre-commit-config.yaml') }} - - - name: Install dependencies - run: pip install pre-commit - - - name: Install pre-commit hooks - run: pre-commit install - - - name: Run pre-commit - run: pre-commit run --all-files --color always + pre-commit-config: ./.pre-commit-config.yaml diff --git a/.github/workflows/molecule.yml b/.github/workflows/molecule.yml index c6bd20d..acbfdf8 100644 --- a/.github/workflows/molecule.yml +++ b/.github/workflows/molecule.yml @@ -1,4 +1,4 @@ -name: "mirsg.docker" +name: Molecule Test on: pull_request: push: @@ -14,28 +14,11 @@ jobs: molecule_scenario: - centos7 - rocky8 - env: PY_COLORS: 1 ANSIBLE_FORCE_COLOR: 1 - steps: - - name: Check out code - uses: actions/checkout@v4 - - - name: Set up Python 3.9 - uses: actions/setup-python@v4 + - name: Run `molecule test` + uses: UCL-MIRSG/.github/actions/molecule-test@v0.25.0 with: - python-version: 3.9 - - - name: Install test dependencies - run: | - sudo apt-get update && sudo apt-get -y install rsync - python3 -m pip install --upgrade pip - python3 -m pip install ansible ansible-lint molecule molecule-plugins[docker] docker requests==2.29.0 - - - name: Run role tests - run: >- - molecule --version && - ansible --version && - molecule --debug test -s ${{ matrix.molecule_scenario }} + scenario: ${{ matrix.molecule_scenario }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d4620ab..5f73b77 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,33 +1,5 @@ repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + - repo: https://github.com/UCL-MIRSG/.github + rev: v0.25.0 hooks: - - id: check-added-large-files - - id: check-case-conflict - - id: check-docstring-first - - id: check-executables-have-shebangs - - id: check-merge-conflict - - id: check-yaml - - id: end-of-file-fixer - - id: fix-byte-order-marker - - id: mixed-line-ending - args: [--fix=lf] - - id: trailing-whitespace - - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.5.4 - hooks: - - id: forbid-tabs - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.3 - hooks: - - id: prettier - exclude: ".yml$" - - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.27.0 - hooks: - - id: check-github-workflows - - repo: https://github.com/ansible-community/ansible-lint.git - rev: v6.21.1 - hooks: - - id: ansible-lint - args: ["-p", "."] + - id: mirsg-hooks diff --git a/README.md b/README.md index 76972f9..99cf35b 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ All variables are nested in the `docker` dictionary. See [defaults/main.yml](def | Name | Description | | ------------------ | ------------------------------------------------------------------------------------------------------- | | `owner` | The OS user that will have ownership of the Docker service file and directory. Defaults to `root` | -| `group` | The OS group that will have ownership of the Docker service file and directory. Deafults to `root` | +| `group` | The OS group that will have ownership of the Docker service file and directory. Defaults to `root` | | `service_file_dir` | The path to the Docker service. Defaults to `/etc/systemd/system/docker.service.d` | | `service_name` | The name of the Docker service. Defaults to `docker` | | `repo_url` | The url of the Docker repository. Defaults to `https://download.docker.com/linux/centos/docker-ce.repo` | diff --git a/meta/main.yml b/meta/main.yml index a2fbc9a..a8aec72 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -41,7 +41,8 @@ galaxy_info: # - 7 # - 99.99 - galaxy_tags: [] + galaxy_tags: + [] # List tags for your role here, one per line. A tag is a keyword that describes # and categorizes the role. Users find roles by searching for tags. Be sure to # remove the '[]' above, if you add tags to this list.