From 8caaeac1b99c661a3185b28823bfa197440dab83 Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Fri, 25 Aug 2023 14:27:09 +0200 Subject: [PATCH 1/5] Add Github Actions Integration --- .github/workflows/build.yml | 63 +++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c485581 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,63 @@ +name: Build and Test + +on: + workflow_dispatch: + push: + branches: [ main, beta ] + pull_request: + branches: [ main, beta ] + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} + +env: + NODE_VERSION: 18 + CACHE_KEY: '${{ github.ref }}-${{ github.run_id }}-${{ github.run_attempt }}' + +jobs: + + build: + strategy: + matrix: + node: [ 16, 18, 20 ] + + name: Build Package (Node ${{ matrix.node }}) + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + cache: 'npm' + + - name: Install dependencies + run: npm ci --include=dev + + - name: Build package + run: npm run build + + - name: Lint + run: npm run lint && npm run lint:package + + - name: Run Tests against browser + run: npm run test:browser + + - name: Run Tests against node + run: npm run test:node + + - name: Save build artifacts + uses: actions/cache/save@v3 + with: + path: . + key: ${{ env.CACHE_KEY }} + + + + From 97989957b2032ecdd4f4e5a116cc486c3a109e24 Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Fri, 25 Aug 2023 19:21:25 +0200 Subject: [PATCH 2/5] Apply suggestions from code review Co-authored-by: Jon Koops --- .github/workflows/build.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c485581..b9541bd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,10 +12,9 @@ permissions: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} env: - NODE_VERSION: 18 CACHE_KEY: '${{ github.ref }}-${{ github.run_id }}-${{ github.run_attempt }}' jobs: @@ -35,7 +34,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} - cache: 'npm' + cache: npm - name: Install dependencies run: npm ci --include=dev @@ -46,17 +45,12 @@ jobs: - name: Lint run: npm run lint && npm run lint:package - - name: Run Tests against browser + - name: Run tests against browser run: npm run test:browser - - name: Run Tests against node + - name: Run tests against Node run: npm run test:node - - name: Save build artifacts - uses: actions/cache/save@v3 - with: - path: . - key: ${{ env.CACHE_KEY }} From 14ced00cf6300b093ca30075b4f3416f7091787c Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Fri, 25 Aug 2023 19:23:01 +0200 Subject: [PATCH 3/5] Update build.yml --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b9541bd..9942ed4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,9 +14,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} -env: - CACHE_KEY: '${{ github.ref }}-${{ github.run_id }}-${{ github.run_attempt }}' - jobs: build: From d42bcd0bb0d745249eef200d8e969e51c4f6115d Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Sat, 26 Aug 2023 18:55:27 +0200 Subject: [PATCH 4/5] Update .github/workflows/build.yml Co-authored-by: Jon Koops --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9942ed4..912fc65 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: cache: npm - name: Install dependencies - run: npm ci --include=dev + run: npm ci - name: Build package run: npm run build From fd5bbcce4cec5ebe18e3dd5f3dc848fb192ede56 Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Sat, 26 Aug 2023 18:55:35 +0200 Subject: [PATCH 5/5] Update .github/workflows/build.yml Co-authored-by: Jon Koops --- .github/workflows/build.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 912fc65..1dad887 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,8 +47,3 @@ jobs: - name: Run tests against Node run: npm run test:node - - - - -