From 005ae1a740cae2507e4bb8818497f5ef8c4c0889 Mon Sep 17 00:00:00 2001 From: Maxim Schram Date: Tue, 10 Oct 2023 15:00:13 -0400 Subject: [PATCH 1/3] ci: initial GHA boilerplate. added .nvmrc. commented out cci config --- .circleci/config.yml | 129 ++++++++++++++++++------------------ .github/workflows/ci-cd.yml | 53 +++++++++++++++ .nvmrc | 1 + 3 files changed, 118 insertions(+), 65 deletions(-) create mode 100644 .github/workflows/ci-cd.yml create mode 100644 .nvmrc diff --git a/.circleci/config.yml b/.circleci/config.yml index 65235b6c..2aec16ab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,70 +1,69 @@ +# version: 2.1 +# orbs: +# commitlint: conventional-changelog/commitlint@1.0.0 +# node: circleci/node@5.1.0 -version: 2.1 -orbs: - commitlint: conventional-changelog/commitlint@1.0.0 - node: circleci/node@5.1.0 +# jobs: +# build-and-test: +# executor: +# name: node/default +# resource_class: medium +# tag: '16.19' +# steps: +# - checkout +# - node/install-packages +# - run: npm run build +# - run: npm run test +# - persist_to_workspace: +# root: ~/project +# paths: +# - . +# deploy: +# executor: +# name: node/default +# resource_class: medium +# tag: '16.19' +# steps: +# - attach_workspace: +# at: ~/project +# - run: npm run semantic-release -jobs: - build-and-test: - executor: - name: node/default - resource_class: medium - tag: '16.19' - steps: - - checkout - - node/install-packages - - run: npm run build - - run: npm run test - - persist_to_workspace: - root: ~/project - paths: - - . - deploy: - executor: - name: node/default - resource_class: medium - tag: '16.19' - steps: - - attach_workspace: - at: ~/project - - run: npm run semantic-release +# workflows: +# commitlint: +# when: +# not: +# or: +# - equal: [ master, <> ] +# - equal: [ develop, <> ] +# - matches: { pattern: "^hotfix.*", value: <> } +# - matches: { pattern: "^release.*", value: <> } +# jobs: +# - commitlint/lint: +# target-branch: develop -workflows: - commitlint: - when: - not: - or: - - equal: [ master, <> ] - - equal: [ develop, <> ] - - matches: { pattern: "^hotfix.*", value: <> } - - matches: { pattern: "^release.*", value: <> } - jobs: - - commitlint/lint: - target-branch: develop +# build-and-test-workflow: +# when: +# not: +# or: +# - equal: [ master, <> ] +# - equal: [ develop, <> ] +# - matches: { pattern: "^hotfix.*", value: <> } +# - matches: { pattern: "^release.*", value: <> } +# jobs: +# - build-and-test - build-and-test-workflow: - when: - not: - or: - - equal: [ master, <> ] - - equal: [ develop, <> ] - - matches: { pattern: "^hotfix.*", value: <> } - - matches: { pattern: "^release.*", value: <> } - jobs: - - build-and-test +# deploy-workflow: +# when: +# or: +# - equal: [ master, <> ] +# - equal: [ develop, <> ] +# - matches: { pattern: "^hotfix.*", value: <> } +# - matches: { pattern: "^release.*", value: <> } - deploy-workflow: - when: - or: - - equal: [ master, <> ] - - equal: [ develop, <> ] - - matches: { pattern: "^hotfix.*", value: <> } - - matches: { pattern: "^release.*", value: <> } - - jobs: - - build-and-test - - deploy: - context: - - scratch-npm-creds - requires: - - build-and-test +# jobs: +# - build-and-test +# - deploy: +# context: +# - scratch-npm-creds +# requires: +# - build-and-test diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 00000000..238e354f --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,53 @@ +name: CI/CD + +on: + workflow_dispatch: # Allows you to run this workflow manually from the Actions tab + pull_request: # Runs whenever a pull request is created or updated + push: # Runs whenever a commit is pushed to the repository + branches: [master, develop, hotfix/*, release] + +concurrency: + group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" + cancel-in-progress: true + +permissions: + contents: write # publish a GitHub release + pages: write # deploy to GitHub Pages + issues: write # comment on released issues + pull-requests: write # comment on released pull requests + +jobs: + ci-cd: + runs-on: ubuntu-latest + env: + TRIGGER_DEPLOY: ${{ startsWith(github.ref, 'refs/heads/master') || startsWith(github.ref, 'refs/heads/hotfix') || startsWith(github.ref, 'refs/heads/develop') || startsWith(github.ref, 'refs/heads/release') }} + steps: + - uses: actions/checkout@v4 + - uses: wagoid/commitlint-github-action@v5 + if: github.event_name == 'pull_request' + - uses: actions/setup-node@v3 + with: + cache: "npm" + node-version-file: ".nvmrc" + + - name: Info + run: | + cat < Date: Tue, 10 Oct 2023 15:12:50 -0400 Subject: [PATCH 2/3] ci: adds .github/CODEOWNERS.md --- .github/CODEOWNERS.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/CODEOWNERS.md diff --git a/.github/CODEOWNERS.md b/.github/CODEOWNERS.md new file mode 100644 index 00000000..a905f98f --- /dev/null +++ b/.github/CODEOWNERS.md @@ -0,0 +1 @@ +@scratchfoundation/scratch-engineering From d9585455dc5945eae90078d7bf6de3ca3fc0d46e Mon Sep 17 00:00:00 2001 From: Maxim Schram Date: Tue, 10 Oct 2023 15:15:46 -0400 Subject: [PATCH 3/3] ci: cleanup --- .github/workflows/ci-cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 238e354f..6d56300a 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -19,12 +19,12 @@ permissions: jobs: ci-cd: runs-on: ubuntu-latest - env: - TRIGGER_DEPLOY: ${{ startsWith(github.ref, 'refs/heads/master') || startsWith(github.ref, 'refs/heads/hotfix') || startsWith(github.ref, 'refs/heads/develop') || startsWith(github.ref, 'refs/heads/release') }} steps: - uses: actions/checkout@v4 + - uses: wagoid/commitlint-github-action@v5 if: github.event_name == 'pull_request' + - uses: actions/setup-node@v3 with: cache: "npm"