diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index e0720b5..624187b 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -11,19 +11,54 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 with: node-version: '20' - + cache: 'npm' + cache-dependency-path: type-from-json/package-lock.json + - name: Install dependencies - run: npm ci - - - name: Run linter - run: npm run lint - + run: | + cd type-from-json + npm ci + + - name: Run linting + run: | + cd type-from-json + npm run lint + - name: Run tests - run: npm test - + run: | + cd type-from-json + npm test + + build: + needs: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: type-from-json/package-lock.json + + - name: Install dependencies + run: | + cd type-from-json + npm ci + - name: Build project - run: npm run build + run: | + cd type-from-json + npm run build + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: dist + path: type-from-json/dist/