diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml new file mode 100644 index 0000000..d280151 --- /dev/null +++ b/.github/workflows/cicd.yml @@ -0,0 +1,91 @@ +name: Deno CI + +on: + push: + pull_request: + +jobs: + setup: + name: Setup Deno + runs-on: ubuntu-latest + outputs: + deno-cache: ${{ steps.cache.outputs.cache-hit }} + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Cache Deno modules + id: cache + uses: actions/cache@v3 + with: + path: ~/.cache/deno + key: ${{ runner.os }}-deno-cache + + - name: Setup Deno + uses: denoland/setup-deno@v2 + with: + deno-version: v2.x + + check: + name: Deno Check + runs-on: ubuntu-latest + needs: setup + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Deno + uses: denoland/setup-deno@v2 + with: + deno-version: v2.x + + - name: Deno Check + run: deno check . + + lint: + name: Deno Lint + runs-on: ubuntu-latest + needs: setup + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Deno + uses: denoland/setup-deno@v2 + with: + deno-version: v2.x + + - name: Deno Lint + run: deno lint + + format: + name: Deno Format Check + runs-on: ubuntu-latest + needs: setup + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Deno + uses: denoland/setup-deno@v2 + with: + deno-version: v2.x + + - name: Deno Format Check + run: deno fmt --check + + test: + name: Deno Test + runs-on: ubuntu-latest + needs: setup + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Deno + uses: denoland/setup-deno@v2 + with: + deno-version: v2.x + + - name: Deno Test + run: deno test --allow-all