From 62872e61bab492bd67e107d88226c0714feb2a71 Mon Sep 17 00:00:00 2001 From: Mahesh Makani Date: Wed, 5 Jan 2022 15:22:20 +0000 Subject: [PATCH] ci: use github actions for ci --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ .github/workflows/jest.yml | 12 ------------ .github/workflows/lint.yml | 12 ------------ .github/workflows/typescript.yml | 12 ------------ ci.sh | 7 ++++++- package.json | 2 +- 6 files changed, 27 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/jest.yml delete mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/typescript.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..d2c5c9135 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,20 @@ +name: CI +on: push +jobs: + CI: + name: Continuous Integration + runs-on: ubuntu-latest + permissions: + # required by guardian/actions-assume-aws-role + id-token: write + contents: read + steps: + - uses: actions/checkout@v2 + - uses: guardian/actions-assume-aws-role@v1.0.0 + with: + awsRoleToAssume: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }} + - uses: actions/setup-node@v2 + with: + node-version-file: '.nvmrc' + cache: 'yarn' + - run: ./ci.sh diff --git a/.github/workflows/jest.yml b/.github/workflows/jest.yml deleted file mode 100644 index 78ae86f05..000000000 --- a/.github/workflows/jest.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: jest -on: push -jobs: - jest: - name: Jest - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install modules - run: yarn - - name: Run tests - run: CI=true yarn test diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 1e3b2cb40..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: lint -on: push -jobs: - jest: - name: Lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install modules - run: yarn - - name: Run eslint - run: yarn lint diff --git a/.github/workflows/typescript.yml b/.github/workflows/typescript.yml deleted file mode 100644 index f3fb33b1d..000000000 --- a/.github/workflows/typescript.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: tsc -on: push -jobs: - jest: - name: Typescript - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install modules - run: yarn - - name: Run type checking - run: yarn tsc diff --git a/ci.sh b/ci.sh index 2c28f443c..22aa6d43b 100755 --- a/ci.sh +++ b/ci.sh @@ -2,7 +2,12 @@ set -ae +# Don't remove this line as it's used to number the build based on the +# last build number in teamcity +LAST_TEAMCITY_BUILD=5000 +export GITHUB_RUN_NUMBER=$(( $GITHUB_RUN_NUMBER + $LAST_TEAMCITY_BUILD )) + yarn install --frozen-lockfile -yarn lint yarn test yarn build +yarn riffraff diff --git a/package.json b/package.json index 422768120..4662553c7 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "mock-server": "node util/mock-server.js", "riffraff": "node-riffraff-artifact", "start": "node ./build/server.js", - "test": "yarn tsc && yarn test:unit", + "test": "yarn lint && yarn tsc && yarn test:unit", "test:unit": "jest --ci", "tsc": "tsc --noEmit --skipLibCheck", "tsc:cypress": "tsc --noEmit --skipLibCheck --project cypress/tsconfig.json",