diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 253bcb7..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: github-actions - directory: / - schedule: - interval: daily diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index f3002ff..7881fb5 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,13 +1,15 @@ -name: Main workflow +name: Test Plugin on: - push: pull_request: + push: schedule: - - cron: 0 0 * * 5 + - cron: 0 1 * * MON jobs: - plugin_test: + test-plugin: + name: Test Plugin + strategy: fail-fast: false matrix: @@ -18,50 +20,6 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: asdf_plugin_test - uses: asdf-vm/actions/plugin-test@v1 + - uses: asdf-vm/actions/plugin-test@v2 with: command: ccache --version - env: - GITHUB_API_TOKEN: ${{ github.token }} - - test: - runs-on: macos-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Install asdf - run: git clone https://github.com/asdf-vm/asdf.git $HOME/asdf - - - name: Test plugin - run: | - . $HOME/asdf/asdf.sh - asdf plugin-add ccache $GITHUB_WORKSPACE - bats test - env: - GITHUB_API_TOKEN: ${{ github.token }} - - lint: - runs-on: macos-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Run ShellCheck - run: shellcheck bin/* - - format: - runs-on: macos-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Install shfmt - run: brew install shfmt - - - name: Run shfmt - run: shfmt -d -i 2 -ci . diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..740ab65 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +SRCFILES = $(shell git ls-files "bin/**") +SHFMT_BASE_FLAGS = -s -i 2 -ci + +format: + shfmt -w $(SHFMT_BASE_FLAGS) $(SRCFILES) +.PHONY: format + +format-check: + shfmt -d $(SHFMT_BASE_FLAGS) $(SRCFILES) +.PHONY: format-check + +lint: + shellcheck $(SRCFILES) +.PHONY: lint diff --git a/README.md b/README.md index 6d9c909..00f776d 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ # Build history -[![Build history](https://buildstats.info/github/chart/asdf-community/asdf-ccache?branch=master)](https://github.com/asdf-community/asdf-ccache/actions) - ## Prerequirements - Make sure you have the required dependencies installed: diff --git a/bin/install b/bin/install index 0ce55e1..9e46262 100755 --- a/bin/install +++ b/bin/install @@ -47,7 +47,7 @@ install_ccache() { cd "$distination" echo "∗ Configuring..." - if [[ "$version" =~ ^[0-3]\. ]]; then + if [[ $version =~ ^[0-3]\. ]]; then ./configure --prefix="$install_path" >/dev/null || fail "Could not configure" else mkdir build diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..dd7d50a --- /dev/null +++ b/renovate.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["config:base", "schedule:daily"] +} diff --git a/test/install.bats b/test/install.bats deleted file mode 100644 index e65997c..0000000 --- a/test/install.bats +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bats -# -# Copyright 2019 asdf-ccache authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -@test "install command fails if the input is not version number" { - run asdf install ccache ref - [ "$status" -eq 1 ] - echo "$output" | grep "supports release installs only" -}