Skip to content

Commit

Permalink
chore: setup workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
hasundue committed Jul 28, 2024
1 parent b34e85d commit 6041bcd
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 13 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check

on:
workflow_call:
workflow_dispatch:

permissions:
contents: read

jobs:
check:
name: Check
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Deno
uses: denoland/setup-deno@v1

- name: Check format
run: deno fmt

- name: Check lint
run: deno lint
18 changes: 5 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,10 @@ permissions:
contents: read

jobs:
check:
name: Check
uses: ./.github/workflows/check.yml

test:
name: Test
uses: hasundue/actions/.github/workflows/test-deno.yml@main
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
task: test:unit
submodules: true

integration:
name: Integration
uses: hasundue/actions/.github/workflows/integration-deno.yml@main
with:
task: test:integration
submodules: true
uses: ./.github/workflows/test.yml
77 changes: 77 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Test

on:
workflow_call:
workflow_dispatch:

permissions:
contents: read

defaults:
run:
shell: bash

jobs:
test:
name: Test

strategy:
fail-fast: false
matrix:
package:
- cli
- core
- integration
- lib
os:
- ubuntu-latest
- macos-latest
- windows-latest

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodule: matrix.package == 'core'

- name: Setup Deno
uses: denoland/setup-deno@v1

- name: Setup Deno cache
uses: actions/cache@v4
with:
path: ~/.cache/deno
key: deno-${{ hashFiles('./deno.lock') }}
restore-keys: deno

- name: Setup Rust cache
if: matrix.package == 'core'
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ hashFiles('./**/Cargo.lock') }}
restore-keys: cargo

- name: Build core/deno_lockfile
if: matrix.package == 'core'
run: |
cd core/deno_lockfile
deno task build
- name: Run tests
run: deno test -A --unstable-kv --coverage=./coverage_profile ${{ matrix.package }}

- name: Create coverage report
run: deno coverage ./coverage_profile --lcov --output=./coverage.lcov

- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
directory: ./
file: ./coverage.lcov
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"workspace": [
"./cli",
"./core",
"./core/deno_lockfile",
"./integration",
"./lib"
]
Expand Down

0 comments on commit 6041bcd

Please sign in to comment.