From 0dd1674d5d6058932a8fd86e1d7c5d8a4b09e710 Mon Sep 17 00:00:00 2001 From: AlexNg Date: Sun, 28 Apr 2024 16:41:54 +0800 Subject: [PATCH 1/6] ci(test): Update tests ci Ref: #26 Waiting on #23 --- .github/workflows/test-worker.yml | 68 +++++++------------------------ 1 file changed, 14 insertions(+), 54 deletions(-) diff --git a/.github/workflows/test-worker.yml b/.github/workflows/test-worker.yml index cd50340..c71f492 100644 --- a/.github/workflows/test-worker.yml +++ b/.github/workflows/test-worker.yml @@ -1,4 +1,4 @@ -name: Run Test Suite +name: Run Tests on: push: @@ -16,9 +16,8 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} jobs: - # This test suite will run for every language version for every OS defined in the matrix - tests-os-matrix: - name: '${{ matrix.language_version }} on ${{ matrix.os }}' + tests: + name: 'Node.Js ${{ matrix.language_version }} on ${{ matrix.os }}' runs-on: '${{ matrix.os }}-latest' strategy: @@ -28,76 +27,37 @@ jobs: - ubuntu - windows - macos - # Place your language versions you want to test - language_version: ['v1.0.0', 'v2.0.0'] - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - # Setup your language (This is specific to each language) - # - name: Set up language ${{ matrix.language_version }} - # uses: actions/setup-python@v5 - # with: - # language-version: ${{ matrix.language_version }} - - - name: Install dependencies - run: | - set -xe - echo "Installed dependencies" - # python -m pip install -r requirements.txt (for example) - - - name: Build project - run: | - set -xe - echo "Building" - # Place your code to build your project here - - - name: Testing - run: | - set -xe - echo "Testing project" - # Place your code to test your project here - # This test will run once - tests: - name: 'Testing' - runs-on: ubuntu-latest + node_version: + - 18 + - 20 steps: - name: Checkout repository uses: actions/checkout@v4 - # Setup your language (This is specific to each language) - # - name: Set up language ${{ matrix.language_version }} - # uses: actions/setup-python@v5 - # with: - # language-version: ${{ matrix.language_version }} + - name: Set up Node.js ${{ matrix.node_version }} + uses: actions/setup-node@v4.0.2 + with: + cache: npm + node-version: ${{ matrix.node_version }} - name: Install dependencies run: | set -xe - echo "Installed dependencies" - # python -m pip install -r requirements.txt (for example) - - - name: Build project - run: | - set -xe - echo "Building" - # Place your code to build your project here + npm i - name: Testing run: | set -xe echo "Testing project" - # Place your code to test your project here + # npm run test - # It is recommended to require this check to pass before merging a pull request check: if: always() name: Tests Successful runs-on: ubuntu-latest - needs: [tests-os-matrix, tests] + needs: [tests] steps: - name: Whether the whole test suite passed From b5b678fcd762ccb0cbc62216357027222aed22ee Mon Sep 17 00:00:00 2001 From: AlexNg Date: Sun, 28 Apr 2024 16:44:07 +0800 Subject: [PATCH 2/6] ci(test): Update job name --- .github/workflows/test-worker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-worker.yml b/.github/workflows/test-worker.yml index c71f492..dcc2d6f 100644 --- a/.github/workflows/test-worker.yml +++ b/.github/workflows/test-worker.yml @@ -17,8 +17,8 @@ concurrency: jobs: tests: - name: 'Node.Js ${{ matrix.language_version }} on ${{ matrix.os }}' - runs-on: '${{ matrix.os }}-latest' + name: "Node.Js ${{ matrix.node_version }} on ${{ matrix.os }}" + runs-on: "${{ matrix.os }}-latest" strategy: fail-fast: false From c6c81990bbd5d60ebbd365a9ee7f26a3e39016c5 Mon Sep 17 00:00:00 2001 From: AlexNg Date: Mon, 29 Apr 2024 10:49:56 +0800 Subject: [PATCH 3/6] ci(test): Add latest node ver --- .github/workflows/test-worker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-worker.yml b/.github/workflows/test-worker.yml index dcc2d6f..b8e9e6f 100644 --- a/.github/workflows/test-worker.yml +++ b/.github/workflows/test-worker.yml @@ -31,6 +31,7 @@ jobs: node_version: - 18 - 20 + - latest steps: - name: Checkout repository From b519ca5f654ee5be064903a5e0f78e9119367597 Mon Sep 17 00:00:00 2001 From: AlexNg Date: Mon, 29 Apr 2024 10:50:12 +0800 Subject: [PATCH 4/6] ci(test): Add Node.Jsv16 --- .github/workflows/test-worker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-worker.yml b/.github/workflows/test-worker.yml index b8e9e6f..9f0710e 100644 --- a/.github/workflows/test-worker.yml +++ b/.github/workflows/test-worker.yml @@ -29,6 +29,7 @@ jobs: - macos node_version: + - 16 - 18 - 20 - latest From 9c6ba302b0aef95507589dd926c3b08d7a877aa7 Mon Sep 17 00:00:00 2001 From: AlexNg Date: Mon, 29 Apr 2024 10:50:24 +0800 Subject: [PATCH 5/6] docs: Update setup command --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index a9abd8e..54eea10 100644 --- a/README.md +++ b/README.md @@ -45,9 +45,7 @@ A simple repository template to get started with GitHub. Run the setup script to get started! ```sh -# Mark setup as executable -chmod +x ./setup.sh -./setup.sh +node ./setup.js ```

(back to top)

From f12b062b85ea6754a1aa074ad7e5a566733b2023 Mon Sep 17 00:00:00 2001 From: AlexNg Date: Mon, 29 Apr 2024 10:51:27 +0800 Subject: [PATCH 6/6] style: Format code --- .github/workflows/test-worker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-worker.yml b/.github/workflows/test-worker.yml index 9f0710e..2ca17f9 100644 --- a/.github/workflows/test-worker.yml +++ b/.github/workflows/test-worker.yml @@ -17,8 +17,8 @@ concurrency: jobs: tests: - name: "Node.Js ${{ matrix.node_version }} on ${{ matrix.os }}" - runs-on: "${{ matrix.os }}-latest" + name: 'Node.Js ${{ matrix.node_version }} on ${{ matrix.os }}' + runs-on: '${{ matrix.os }}-latest' strategy: fail-fast: false