From 2354678b8454ecb4c7bc5b7e8ee33d71f90026f5 Mon Sep 17 00:00:00 2001 From: Gilbert Gilb's Date: Fri, 8 Apr 2022 16:16:44 +0200 Subject: [PATCH] migrate to GitHub Actions instead of Azure pipelines --- .github/workflows/main.yml | 58 +++++++++++++++++++++++++++++ README.md | 2 +- azure-pipelines.yml | 76 -------------------------------------- 3 files changed, 59 insertions(+), 77 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 azure-pipelines.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..a632b47 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,58 @@ +--- +name: CI + +on: [push, pull_request] + +env: + MAIN_NODE_VERSION: "16" + +jobs: + static-checks: + runs-on: ubuntu-latest + name: Run static checks + steps: + - uses: actions/checkout@v3 + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: ${{ env.MAIN_NODE_VERSION }} + cache: 'yarn' + - run: yarn install + - run: yarn run types + tests: + needs: [static-checks] + runs-on: ubuntu-latest + name: Run tests + strategy: + matrix: + node: [ '12', '14', '16', '17' ] + steps: + - uses: actions/checkout@v3 + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + cache: 'yarn' + - name: Install dependencies + run: yarn install + - name: Run tests + run: yarn run test --coverage + - name: Publish code coverage + if: "${{ env.CC_TEST_REPORTER_ID != '' }}" + uses: paambaati/codeclimate-action@v3.0.0 + build: + needs: [tests] + runs-on: ubuntu-latest + name: Build + steps: + - uses: actions/checkout@v3 + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: ${{ env.MAIN_NODE_VERSION }} + - run: yarn install + - run: yarn run build + - uses: actions/upload-artifact@v3 + with: + name: babel-plugin-i18next-extract + path: lib/ diff --git a/README.md b/README.md index a480c20..07986a4 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ # babel-plugin-i18next-extract [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -[![Build Status](https://dev.azure.com/gilbsgilbert/babel-plugin-i18next-extract/_apis/build/status/gilbsgilbs.babel-plugin-i18next-extract?branchName=master)](https://dev.azure.com/gilbsgilbert/babel-plugin-i18next-extract/_build/latest?definitionId=1&branchName=master) +[![CI](https://github.com/gilbsgilbs/babel-plugin-i18next-extract/actions/workflows/main.yml/badge.svg)](https://github.com/gilbsgilbs/babel-plugin-i18next-extract/actions/workflows/main.yml) [![Netlify Status](https://api.netlify.com/api/v1/badges/c3597f83-d80e-428e-b194-f11fe162a893/deploy-status)](https://app.netlify.com/sites/i18next-extract/deploys) [![Test Coverage](https://api.codeclimate.com/v1/badges/e4badc4fb62625cbff0e/test_coverage)](https://codeclimate.com/github/gilbsgilbs/babel-plugin-i18next-extract/test_coverage) diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index a874973..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,76 +0,0 @@ -trigger: - branches: - include: - - master - - features/* - - releases/* - - renovate/* - tags: - include: - - '*' - -stages: - - stage: checks - displayName: Static checks - jobs: - - template: .ci/templates/docker-jobs.yml - parameters: - jobs: - - job: lint - displayName: Run ESLint - steps: - - script: yarn install && yarn run lint - - job: types - displayName: Run Typing Checks - steps: - - script: yarn install && yarn run types - - job: audit - displayName: Run Yarn Audit - continueOnError: true - steps: - - script: yarn install && yarn audit - - script: cd docs && yarn install && yarn audit - - stage: tests - displayName: Run tests - jobs: - - template: .ci/templates/docker-jobs.yml - parameters: - jobs: - - job: test - displayName: Run tests suite - strategy: - matrix: - node10: - container: 'node:10' - node12: - container: 'node:12' - node13: - container: 'node:13' - steps: - - script: > - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - && chmod +x ./cc-test-reporter - - script: yarn install - - script: > - ./cc-test-reporter before-build - && yarn run test --coverage - && ./cc-test-reporter after-build --exit-code $? - env: - CC_TEST_REPORTER_ID: $(codeclimate.token) - GIT_BRANCH: $(Build.SourceBranchName) - GIT_COMMIT_SHA: $(Build.SourceVersion) - - stage: build - displayName: Build Project - jobs: - - template: .ci/templates/docker-jobs.yml - parameters: - jobs: - - job: build - displayName: Build - steps: - - script: yarn install && yarn run build - - task: PublishPipelineArtifact@0 - inputs: - targetPath: lib/ - artifactName: babel-plugin-i18next-extract -