From bb3059e6e483612d6a6bad9dd2b533c7bbd5f1bf Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Sun, 5 Mar 2023 14:49:39 +0300 Subject: [PATCH 1/4] #73 add reusable actions, add workflow for quality checking --- .github/workflows/build.yml | 27 ------------------- .github/workflows/lint.yml | 27 ------------------- .github/workflows/quality-checking.yml | 37 ++++++++++++++++++++++++++ .github/workflows/reusable/build.yml | 28 +++++++++++++++++++ .github/workflows/reusable/lint.yml | 28 +++++++++++++++++++ .github/workflows/reusable/test.yml | 28 +++++++++++++++++++ .github/workflows/test.yml | 27 ------------------- package-lock.json | 4 +-- package.json | 2 +- 9 files changed, 124 insertions(+), 84 deletions(-) delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/quality-checking.yml create mode 100644 .github/workflows/reusable/build.yml create mode 100644 .github/workflows/reusable/lint.yml create mode 100644 .github/workflows/reusable/test.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index c58043e..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Build - -on: - push: - branches: [ 'main' ] - pull_request: - branches: [ 'main' ] - -jobs: - build: - - strategy: - matrix: - node-version: [ 18.x ] - os: [ ubuntu-latest ] - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm install - - run: npm run build diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index faf6c9b..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Lint - -on: - push: - branches: [ 'main' ] - pull_request: - branches: [ 'main' ] - -jobs: - lint: - - strategy: - matrix: - node-version: [ 18.x ] - os: [ ubuntu-latest ] - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm install - - run: npm run lint diff --git a/.github/workflows/quality-checking.yml b/.github/workflows/quality-checking.yml new file mode 100644 index 0000000..bf16d3e --- /dev/null +++ b/.github/workflows/quality-checking.yml @@ -0,0 +1,37 @@ +name: Lint & Test & Build + +on: + workflow_dispatch: + pull_request: + branches: + - main + - development + push: + branches: + - main + +env: + node-version: 18.x + os: ubuntu-latest + +jobs: + lint: + name: Lint + uses: ./.github/workflows/reusable/lint.yml + with: + os: ${{ env.os }} + node-version: ${{ env.node-version }} + + test: + name: Test + uses: ./.github/workflows/reusable/test.yml + with: + os: ${{ env.os }} + node-version: ${{ env.node-version }} + + build: + name: Build + uses: ./.github/workflows/reusable/build.yml + with: + os: ${{ env.os }} + node-version: ${{ env.node-version }} diff --git a/.github/workflows/reusable/build.yml b/.github/workflows/reusable/build.yml new file mode 100644 index 0000000..3a62740 --- /dev/null +++ b/.github/workflows/reusable/build.yml @@ -0,0 +1,28 @@ +name: Build + +on: + workflow_call: + inputs: + os: + type: string + required: true + description: operating system + node-version: + type: string + required: true + description: node.js version + +jobs: + build: + + runs-on: ${{ inputs.os }} + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ inputs.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ inputs.node-version }} + cache: 'npm' + - run: npm install + - run: npm run build diff --git a/.github/workflows/reusable/lint.yml b/.github/workflows/reusable/lint.yml new file mode 100644 index 0000000..86c308e --- /dev/null +++ b/.github/workflows/reusable/lint.yml @@ -0,0 +1,28 @@ +name: Lint + +on: + workflow_call: + inputs: + os: + type: string + required: true + description: operating system + node-version: + type: string + required: true + description: node.js version + +jobs: + lint: + + runs-on: ${{ inputs.os }} + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ inputs.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ inputs.node-version }} + cache: 'npm' + - run: npm install + - run: npm run lint diff --git a/.github/workflows/reusable/test.yml b/.github/workflows/reusable/test.yml new file mode 100644 index 0000000..b2c9d21 --- /dev/null +++ b/.github/workflows/reusable/test.yml @@ -0,0 +1,28 @@ +name: Test + +on: + workflow_call: + inputs: + os: + type: string + required: true + description: operating system + node-version: + type: string + required: true + description: node.js version + +jobs: + test: + + runs-on: ${{ inputs.os }} + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ inputs.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ inputs.node-version }} + cache: 'npm' + - run: npm install + - run: npm run test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 03ba2c0..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Test - -on: - push: - branches: [ 'main' ] - pull_request: - branches: [ 'main' ] - -jobs: - test: - - strategy: - matrix: - node-version: [ 18.x ] - os: [ ubuntu-latest ] - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm install - - run: npm run test diff --git a/package-lock.json b/package-lock.json index 40b0c2b..4731943 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "aurora-game-engine", - "version": "1.0.9", + "version": "1.0.10", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "aurora-game-engine", - "version": "1.0.9", + "version": "1.0.10", "license": "GNU GPL v3", "devDependencies": { "@babel/core": "^7.21.0", diff --git a/package.json b/package.json index 12c93f3..30a88bc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurora-game-engine", - "version": "1.0.9", + "version": "1.0.10", "description": "Aurora game engine for creating 1D and 2D games in JavaScript", "keywords": [ "game-engine", From 632f6be2cd8e2c7657ea7ea14ed61b7c4de12e91 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Sun, 5 Mar 2023 15:00:04 +0300 Subject: [PATCH 2/4] #73 replace reusable actions to the parent dir --- .github/workflows/{reusable => }/build.yml | 0 .github/workflows/{reusable => }/lint.yml | 0 .github/workflows/quality-checking.yml | 6 +++--- .github/workflows/{reusable => }/test.yml | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename .github/workflows/{reusable => }/build.yml (100%) rename .github/workflows/{reusable => }/lint.yml (100%) rename .github/workflows/{reusable => }/test.yml (100%) diff --git a/.github/workflows/reusable/build.yml b/.github/workflows/build.yml similarity index 100% rename from .github/workflows/reusable/build.yml rename to .github/workflows/build.yml diff --git a/.github/workflows/reusable/lint.yml b/.github/workflows/lint.yml similarity index 100% rename from .github/workflows/reusable/lint.yml rename to .github/workflows/lint.yml diff --git a/.github/workflows/quality-checking.yml b/.github/workflows/quality-checking.yml index bf16d3e..a9d4dea 100644 --- a/.github/workflows/quality-checking.yml +++ b/.github/workflows/quality-checking.yml @@ -17,21 +17,21 @@ env: jobs: lint: name: Lint - uses: ./.github/workflows/reusable/lint.yml + uses: ./.github/workflows/lint.yml with: os: ${{ env.os }} node-version: ${{ env.node-version }} test: name: Test - uses: ./.github/workflows/reusable/test.yml + uses: ./.github/workflows/test.yml with: os: ${{ env.os }} node-version: ${{ env.node-version }} build: name: Build - uses: ./.github/workflows/reusable/build.yml + uses: ./.github/workflows/build.yml with: os: ${{ env.os }} node-version: ${{ env.node-version }} diff --git a/.github/workflows/reusable/test.yml b/.github/workflows/test.yml similarity index 100% rename from .github/workflows/reusable/test.yml rename to .github/workflows/test.yml From a373af4c9f05d700036b0bb8192e3f7bcba4f651 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Sun, 5 Mar 2023 15:07:04 +0300 Subject: [PATCH 3/4] #73 update env variables --- .github/workflows/quality-checking.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/quality-checking.yml b/.github/workflows/quality-checking.yml index a9d4dea..1a927ee 100644 --- a/.github/workflows/quality-checking.yml +++ b/.github/workflows/quality-checking.yml @@ -11,27 +11,27 @@ on: - main env: - node-version: 18.x - os: ubuntu-latest + NODE_VERSION: 18.x + OS: ubuntu-latest jobs: lint: name: Lint uses: ./.github/workflows/lint.yml with: - os: ${{ env.os }} - node-version: ${{ env.node-version }} + os: $OS + node-version: $NODE_VERSION test: name: Test uses: ./.github/workflows/test.yml with: - os: ${{ env.os }} - node-version: ${{ env.node-version }} + os: $OS + node-version: $NODE_VERSION build: name: Build uses: ./.github/workflows/build.yml with: - os: ${{ env.os }} - node-version: ${{ env.node-version }} + os: $OS + node-version: $NODE_VERSION From 039b8b6367516eef7be67a61ac060c8fad6efa6b Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Sun, 5 Mar 2023 15:19:08 +0300 Subject: [PATCH 4/4] #73 add updated workflows lint, test and build --- .github/workflows/build.yml | 30 ++++++++++++--------- .github/workflows/lint.yml | 30 ++++++++++++--------- .github/workflows/quality-checking.yml | 37 -------------------------- .github/workflows/test.yml | 30 ++++++++++++--------- 4 files changed, 51 insertions(+), 76 deletions(-) delete mode 100644 .github/workflows/quality-checking.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3a62740..51d5c9e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,28 +1,32 @@ name: Build on: - workflow_call: - inputs: - os: - type: string - required: true - description: operating system - node-version: - type: string - required: true - description: node.js version + push: + branches: + - main + pull_request: + branches: + - main + - development + workflow_dispatch: jobs: build: - runs-on: ${{ inputs.os }} + strategy: + matrix: + node-version: [ 18.x ] + os: [ ubuntu-latest ] + + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - - name: Use Node.js ${{ inputs.node-version }} + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: - node-version: ${{ inputs.node-version }} + node-version: ${{ matrix.node-version }} cache: 'npm' - run: npm install - run: npm run build + \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 86c308e..79b3104 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,28 +1,32 @@ name: Lint on: - workflow_call: - inputs: - os: - type: string - required: true - description: operating system - node-version: - type: string - required: true - description: node.js version + push: + branches: + - main + pull_request: + branches: + - main + - development + workflow_dispatch: jobs: lint: - runs-on: ${{ inputs.os }} + strategy: + matrix: + node-version: [ 18.x ] + os: [ ubuntu-latest ] + + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - - name: Use Node.js ${{ inputs.node-version }} + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: - node-version: ${{ inputs.node-version }} + node-version: ${{ matrix.node-version }} cache: 'npm' - run: npm install - run: npm run lint + \ No newline at end of file diff --git a/.github/workflows/quality-checking.yml b/.github/workflows/quality-checking.yml deleted file mode 100644 index 1a927ee..0000000 --- a/.github/workflows/quality-checking.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Lint & Test & Build - -on: - workflow_dispatch: - pull_request: - branches: - - main - - development - push: - branches: - - main - -env: - NODE_VERSION: 18.x - OS: ubuntu-latest - -jobs: - lint: - name: Lint - uses: ./.github/workflows/lint.yml - with: - os: $OS - node-version: $NODE_VERSION - - test: - name: Test - uses: ./.github/workflows/test.yml - with: - os: $OS - node-version: $NODE_VERSION - - build: - name: Build - uses: ./.github/workflows/build.yml - with: - os: $OS - node-version: $NODE_VERSION diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b2c9d21..b6f062c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,28 +1,32 @@ name: Test on: - workflow_call: - inputs: - os: - type: string - required: true - description: operating system - node-version: - type: string - required: true - description: node.js version + push: + branches: + - main + pull_request: + branches: + - main + - development + workflow_dispatch: jobs: test: - runs-on: ${{ inputs.os }} + strategy: + matrix: + node-version: [ 18.x ] + os: [ ubuntu-latest ] + + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - - name: Use Node.js ${{ inputs.node-version }} + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: - node-version: ${{ inputs.node-version }} + node-version: ${{ matrix.node-version }} cache: 'npm' - run: npm install - run: npm run test + \ No newline at end of file