Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

chore: Move CI to GitHub Actions #213

Merged
merged 2 commits into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@ on:
branches:
- main
jobs:
cdk-test:
CI:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
strategy:
matrix:
node-version: [14.15.1]
steps:
- uses: actions/checkout@v2
- uses: guardian/actions-assume-aws-role@v1.0.0
with:
awsRoleToAssume: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2.4.0
with:
node-version: ${{ matrix.node-version }}
- run: ./scripts/test-cdk.sh
- run: ./scripts/ci.sh
2 changes: 0 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,3 @@ $ yarn test
== How to deploy

Deploy this app through TeamCity and RiffRaff. See what CI is doing in `scripts/ci.sh`

To generate the Cloudformation to create a stack, you can run `scripts/generate-cfn.sh`
2 changes: 1 addition & 1 deletion lambda/artifact.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"projectName": "Deploy Tools::Tag Janitor",
"projectName": "devx::Tag Janitor",
"vcsURL": "https://github.com/guardian/tag-janitor",
"actions": [
{
Expand Down
2 changes: 1 addition & 1 deletion lambda/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"license": "ISC",
"description": "",
"devDependencies": {
"@guardian/node-riffraff-artifact": "^0.2.2",
"@guardian/node-riffraff-artifact": "^0.3.0",
"@types/jest": "^27.0.1",
"@types/node": "^16.7.10",
"aws-sdk": "^2.983.0",
Expand Down
8 changes: 4 additions & 4 deletions lambda/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,10 @@
resolved "https://registry.yarnpkg.com/@guardian/anghammarad/-/anghammarad-1.0.2.tgz#f2a71310ff990d8cc234819f616195c7b126c272"
integrity sha512-BLmCBFrj0iSzAQdpr2Ha+T3j/RmO9vnAjUy6FlqYtQ1Y14TUmmxXJC5qT1Ao49lIcG8rLbkgg0LSA4Q17T3mPw==

"@guardian/node-riffraff-artifact@^0.2.2":
version "0.2.2"
resolved "https://registry.yarnpkg.com/@guardian/node-riffraff-artifact/-/node-riffraff-artifact-0.2.2.tgz#ec85c9f37410c844fa4e6343272ae391fe183ed7"
integrity sha512-o0tfVEW8iT2G0uKalJT9g1xeEpAKf3nfeJbDy/bCUs+EdybaiLh/y6TN2200J+sH10Rjtf0/DoX8MqT9d2P+8A==
"@guardian/node-riffraff-artifact@^0.3.0":
version "0.3.0"
resolved "https://registry.yarnpkg.com/@guardian/node-riffraff-artifact/-/node-riffraff-artifact-0.3.0.tgz#1a7d6660f1e7e279aa77537afbd85f8de5bfb3ab"
integrity sha512-J4wyZhJD6g6Ckv7xxNo59CyYxFU93FcaN7819FCAmALNvVu9ABEE8gr1EYcOu29BcG0+oA5KF9GdqbKVSp+f2A==
dependencies:
"@mojotech/json-type-validation" "^3.1.0"
"@types/temp" "^0.8.34"
Expand Down
50 changes: 24 additions & 26 deletions scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,30 @@

set -e

if [[ ! -z "${TEAMCITY_VERSION}" ]]; then
echo "Running in TeamCity. Nope!"
exit 0
fi

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
ROOT_DIR="${DIR}/.."

echo "##teamcity[blockOpened name='generate-cfn']"
"${ROOT_DIR}/scripts/generate-cfn.sh"
echo "##teamcity[blockClosed name='generate-cfn']"

pushd "${ROOT_DIR}/lambda"
echo "##teamcity[blockOpened name='npm']"
yarn --frozen-lockfile
echo "##teamcity[blockClosed name='npm']"

echo "##teamcity[testSuiteStarted name='lint']"
yarn lint
echo "##teamcity[testSuiteFinished name='lint']"

echo "##teamcity[testSuiteStarted name='test']"
yarn test
echo "##teamcity[testSuiteFinished name='test']"

echo "##teamcity[testSuiteStarted name='compile']"
yarn compile
echo "##teamcity[testSuiteFinished name='compile']"

echo "##teamcity[compilationStarted compiler='riffraff']"
yarn riffraff
echo "##teamcity[compilationFinished compiler='riffraff']"

popd
CDK_OUTPUT_DIR="${ROOT_DIR}/cloudformation/cdk"


(
cd "${ROOT_DIR}/cdk"
yarn --frozen-lockfile
yarn lint
yarn test
yarn cdk synth -o "${CDK_OUTPUT_DIR}"
)

(
cd "${ROOT_DIR}/lambda"
yarn --frozen-lockfile
yarn lint
yarn test
yarn compile
yarn riffraff
)
13 changes: 0 additions & 13 deletions scripts/generate-cfn.sh

This file was deleted.

12 changes: 0 additions & 12 deletions scripts/test-cdk.sh

This file was deleted.