From 84f3f4113c4c758d11379ea23f41268ebb211b05 Mon Sep 17 00:00:00 2001 From: cradle8810 Date: Thu, 25 Apr 2024 20:40:40 +0900 Subject: [PATCH] Self run test --- .github/workflows/dnsmasq-exec.yml | 22 ++++++++++ .github/workflows/duplicate_check.yml | 22 ---------- .github/workflows/jobs.yml | 61 +++++++++++++++++++++++++++ .github/workflows/lints.yml | 38 ----------------- .github/workflows/shellspec.yml | 23 ---------- 5 files changed, 83 insertions(+), 83 deletions(-) create mode 100644 .github/workflows/dnsmasq-exec.yml delete mode 100644 .github/workflows/duplicate_check.yml create mode 100644 .github/workflows/jobs.yml delete mode 100644 .github/workflows/lints.yml delete mode 100644 .github/workflows/shellspec.yml diff --git a/.github/workflows/dnsmasq-exec.yml b/.github/workflows/dnsmasq-exec.yml new file mode 100644 index 0000000..a0913a2 --- /dev/null +++ b/.github/workflows/dnsmasq-exec.yml @@ -0,0 +1,22 @@ +--- +name: Update DNS for rui + +on: + workflow_run: + workflows: ["AnsibleLint"] + types: ["completed"] + +jobs: + Dryrun: + runs-on: self-hosted + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: "ansible-play -C --tags dnsmasq rui.yml" + run: | + ansible-playbook \ + -i inventories -C \ + --tags dnsmasq \ + rui.yml diff --git a/.github/workflows/duplicate_check.yml b/.github/workflows/duplicate_check.yml deleted file mode 100644 index 7b972d5..0000000 --- a/.github/workflows/duplicate_check.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -name: Validate Domain Duplication - -on: - push: - branches: - - '**' - -jobs: - Duplicate_Check: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Add exec flag to dupcheck.sh - run: "chmod +x ./dupcheck.sh" - - - name: NXDOMAIN_Duplicate_Check - run: > - "./dupcheck.sh" - "inventories/host_vars/rui/ads_hosts/NXDOMAIN.yml" diff --git a/.github/workflows/jobs.yml b/.github/workflows/jobs.yml new file mode 100644 index 0000000..9613d61 --- /dev/null +++ b/.github/workflows/jobs.yml @@ -0,0 +1,61 @@ +--- +name: Lints + +on: + push: + branches: + - '**' + +jobs: + Yamllint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Run YAML Lint + run: yamllint --strict --format github . + + AnsibleLint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Run Ansible-lint + uses: ansible/ansible-lint@main + + Duplicate_Check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Add exec flag to dupcheck.sh + run: "chmod +x ./dupcheck.sh" + + - name: NXDOMAIN_Duplicate_Check + run: > + "./dupcheck.sh" + "inventories/host_vars/rui/ads_hosts/NXDOMAIN.yml" + + Ansible-rui-dns: + needs: + - Yamllint + - AnsibleLint + - Duplicate_Check + runs-on: self-hosted + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare environments (apt) + run: > + ansible-galaxy install -r requirements.yml + + - name: "ansible-play -C --tags dnsmasq rui.yml" + run: | + ansible-playbook \ + -i inventories -C \ + --tags dnsmasq \ + rui.yml diff --git a/.github/workflows/lints.yml b/.github/workflows/lints.yml deleted file mode 100644 index a638b9b..0000000 --- a/.github/workflows/lints.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -name: Lints - -on: - push: - branches: - - '**' - -jobs: - Yamllint: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Run YAML Lint - run: yamllint --strict --format github . - - AnsibleLint: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Restore pip cache - uses: actions/cache/restore@v4 - with: - path: /home/runner/.cache/pip - key: ansible-hayaworld-pip-cache - - - name: Run Ansible-lint - uses: ansible/ansible-lint@main - - - name: Store pip cache - uses: actions/cache/save@v4 - with: - path: /home/runner/.cache/pip - key: ansible-hayaworld-pip-cache diff --git a/.github/workflows/shellspec.yml b/.github/workflows/shellspec.yml deleted file mode 100644 index ef0fb42..0000000 --- a/.github/workflows/shellspec.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: Validate Domain Duplication Shell Unit Test - -on: - push: - paths: - - "**.sh" - -jobs: - Duplicate_Check: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Add exec flag to dupcheck.sh - run: "chmod +x ./dupcheck.sh" - - - name: Get Shellspec - run: "curl -fsSL https://git.io/shellspec | sh -s -- --yes" - - - name: Run Shellspec - run: "~/.local/lib/shellspec/shellspec"