From 4fca0827dc8125c25fbfffca029b59faa3048347 Mon Sep 17 00:00:00 2001 From: Adrien Montagu Date: Tue, 17 Dec 2024 15:27:17 +0100 Subject: [PATCH] change ci system --- .circleci/config.yml | 33 --------------------------- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 33 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/ci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index eb5d575..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,33 +0,0 @@ -version: 2.1 -jobs: - test: - docker: - - image: cimg/node:20.11.1 - steps: - - checkout - - run: npm install - - run: npm run test:unit - - release: - docker: - - image: cimg/node:20.11.1 - steps: - - checkout - - run: npm install - - run: npm run build - - run: npx semantic-release - -workflows: - version: 2 - test_and_release: - # Run the test jobs first, then the release only when all the test jobs are successful - jobs: - - test - - release: - requires: - - test - filters: - branches: - only: - - main - - next \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8da345d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: CI + +on: + push: + branches: [ main, next ] + pull_request: + branches: [ main, next ] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.11.1' + + - name: Install dependencies + run: npm install + + - name: Run unit tests + run: npm run test:unit + + release: + # This job will only run on pushes to main or next, and after the test job completes successfully. + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next' + runs-on: ubuntu-latest + needs: test + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.11.1' + + - name: Install dependencies + run: npm install + + - name: Build project + run: npm run build + + - name: Semantic release + run: npx semantic-release