From 2ca525fa208bd0ac97844035015173e950cd4a8f Mon Sep 17 00:00:00 2001 From: Bernard Wolff <2744510+bernardwolff@users.noreply.github.com> Date: Thu, 19 Dec 2024 22:13:54 +0000 Subject: [PATCH] switch to github actions --- .circleci/config.yml | 39 -------------------------- .github/workflows/build.yml | 49 ++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 23 +++++++++++++++ .nvmrc | 2 +- Jenkinsfile | 56 ------------------------------------- 5 files changed, 73 insertions(+), 96 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/test.yml delete mode 100644 Jenkinsfile diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 652b1605..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,39 +0,0 @@ -# Javascript Node CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-javascript/ for more details -# -version: 2 -jobs: - build: - docker: - # specify the version you desire here - - image: node:erbium - - # Specify service dependencies here if necessary - # CircleCI maintains a library of pre-built images - # documented at https://circleci.com/docs/2.0/circleci-images/ - # - image: circleci/mongo:3.4.4 - - #working_directory: ~/repo - - steps: - - checkout - - # Download and cache dependencies - - restore_cache: - keys: - - v1-dependencies-{{ checksum "package.json" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- - - - run: yarn - - - save_cache: - paths: - - node_modules - key: v1-dependencies-{{ checksum "package.json" }} - - # run tests! - - run: yarn run lint - - run: yarn test - - run: ./test/bundle_test.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..c37a893d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,49 @@ +name: Build + +on: + push: + # TODO: remove add_build_workflow after we've tested that this works + branches: [ master, add_build_workflow ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '10' + + - name: Install dependencies + run: yarn + + - name: Run Build + run: yarn run build + deploy: + runs-on: ubuntu-latest + needs: build + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '10' + + - name: Install dependencies + run: yarn + + - name: Configure AWS Credentials using OIDC + uses: aws-actions/configure-aws-credentials@v4 + with: + # TODO: update ACCOUNT and UPLOAD_ROLE and store in github secrets for the repo + role-to-assume: arn:aws:iam:::role/ + role-session-name: github-action-account-link-extension-publish + aws-region: us-west-1 + + - name: Run Deploy + run: sh tools/cdn.sh \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..7c8dbcde --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,23 @@ +name: Build + +on: + push: + branches-ignore: [ master ] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '10' + + - name: Install dependencies + run: yarn + + - name: Run Tests + run: yarn run test \ No newline at end of file diff --git a/.nvmrc b/.nvmrc index 12e41412..f599e28b 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -6.9 +10 diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 70ba9f6e..00000000 --- a/Jenkinsfile +++ /dev/null @@ -1,56 +0,0 @@ -pipeline { - agent { - label 'crew-keystone' - } - tools { nodejs '8.11.3' } - stages { - stage('Checkout') { - steps { - checkout scm - } - } - - stage('Installing dependencies') { - steps { - sh 'yarn' - } - } - - stage('Running tests') { - steps { - sh 'yarn test' - } - } - - stage('Build') { - steps { - sh 'yarn run build' - } - } - - stage('Deploy') { - steps { - sh 'tools/cdn.sh' - } - } - } - - post { - // Always runs. And it runs before any of the other post conditions. - always { - // Let's wipe out the workspace before we finish! - deleteDir() - } - } - - // The options directive is for configuration that applies to the whole job. - options { - // For example, we'd like to make sure we only keep 10 builds at a time, so - // we don't fill up our storage! - buildDiscarder(logRotator(numToKeepStr:'10')) - - // And we'd really like to be sure that this build doesn't hang forever, so - // let's time it out after an hour. - timeout(time: 30, unit: 'MINUTES') - } -}