From 98b2a4c3f5a5fcf047d87fd2824efe8d50f6927f 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 | 12 ++++++++++++ 5 files changed, 32 insertions(+), 36 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 0000000000..d2c5c91350 --- /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 78ae86f05b..0000000000 --- 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 1e3b2cb402..0000000000 --- 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 f3fb33b1d9..0000000000 --- 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 2c28f443c3..4fc68c5d98 100755 --- a/ci.sh +++ b/ci.sh @@ -2,7 +2,19 @@ set -ae +# This block can be removed once everyone has rebase their branches to main +if [[ ! -z "${TEAMCITY_VERSION}" ]]; then + echo "Running in TeamCity. Nope!" + exit 0 +fi + +# 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