Skip to content

Commit

Permalink
ci: unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreBeucher committed Aug 1, 2024
1 parent 1c023bc commit 083a06c
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test installation script

on:
push:
branches:
- "master"
pull_request:
branches:
- master

jobs:
unit-test:
name: Unit tests
runs-on: ubuntu-24.04

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

- uses: nixbuild/nix-quick-install-action@v27

- uses: nix-community/cache-nix-action@v5
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
restore-prefixes-first-match: nix-${{ runner.os }}-

- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package*.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Run unit tests
run: nix develop -c task test-unit
1 change: 0 additions & 1 deletion .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"extension": ["ts"],
"spec": "test/**/*.spec.ts",
"require": "ts-node/register"
}
15 changes: 15 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,20 @@ tasks:
cmd: >-
CLOUDYPAD_IMAGE="cloudypad:local" ./cloudypad.sh {{.CLI_ARGS}}
#
# Build and test
#

test-unit:
cmd: npx mocha ./test/unit/**/*.spec.ts

build:
cmd: docker build . -t cloudypad:local

#
# Utils
#

# Generate Typescript Paperspace client from OpenAPI specifications
paperspace-client-gen:
vars:
Expand Down Expand Up @@ -47,6 +58,10 @@ tasks:
-g typescript-axios
-o {{ .PAPERSPACE_GENERATED_DIR }}
#
# Release
#

release-prepare:
cmd: ./hack/prepare-release.sh

Expand Down

0 comments on commit 083a06c

Please sign in to comment.