From b4de307dc4fc98ce665605287dfbb82038d3381b Mon Sep 17 00:00:00 2001 From: Oskar Dudycz Date: Tue, 9 Jul 2024 19:17:34 +0200 Subject: [PATCH] Added build script for simple sample in TypeScript --- .../workflows/build_and_test_sample_ts.yml | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/build_and_test_sample_ts.yml diff --git a/.github/workflows/build_and_test_sample_ts.yml b/.github/workflows/build_and_test_sample_ts.yml new file mode 100644 index 0000000..9b9184d --- /dev/null +++ b/.github/workflows/build_and_test_sample_ts.yml @@ -0,0 +1,54 @@ +name: Build and test Simple Sample TypeScript + +on: + # run it on push to the default repository branch + push: + branches: [main] + paths: + - "samples/simple-ts/**" + - "./.github/workflows/build_and_test_sample_ts.yml" + + # run it during pull request + pull_request: + paths: + - "samples/simple-ts/**" + - "./.github/workflows/build_and_test_sample_ts.yml" + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +defaults: + run: + working-directory: samples/simple-ts + +jobs: + build-and-test-code: + name: Build sample code + # use system defined below in the tests matrix + runs-on: ubuntu-latest + + steps: + - name: Check Out Repo + uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version-file: ./samples/simple-ts/.nvmrc + cache: "npm" + cache-dependency-path: "./samples/simple-ts/package-lock.json" + + - name: Install dependencies + run: npm ci + + - name: Build TS + run: npm run build:ts + + - name: Run linting (ESlint and Prettier) + run: npm run lint + + - name: Build + run: npm run build + + - name: Test + run: npm run test