Skip to content

Commit

Permalink
chore: Add GHA Workflow for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
akash1810 committed Sep 21, 2021
1 parent 9675851 commit c158c7a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 24 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI
on:
pull_request:
workflow_dispatch:
jobs:
CI:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v2

# build CDK first to ensure the template is on disk for SBT to pick up
- name: Use Node.js 14.15.5
uses: actions/setup-node@v2.4.0
with:
node-version: 14.15.5
- name: Generate CDK
working-directory: ./cdk
run: ./script/ci

- uses: guardian/actions-assume-aws-role@hackday
with:
awsRoleToAssume: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- run: ./scripts/ci
19 changes: 0 additions & 19 deletions cdk/script/ci
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,6 @@

set -e

nvm_available() {
type -t nvm > /dev/null
}

source_nvm() {
if ! nvm_available; then
[ -e "/usr/local/opt/nvm/nvm.sh" ] && source /usr/local/opt/nvm/nvm.sh
fi
if ! nvm_available; then
[ -e "$HOME/.nvm/nvm.sh" ] && source "$HOME/.nvm/nvm.sh"
fi
}

source_nvm
nvm install
nvm use

npm install -g yarn

yarn install --frozen-lockfile
yarn lint
yarn build
Expand Down
10 changes: 5 additions & 5 deletions scripts/ci
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ if [[ ! -z "${TEAMCITY_VERSION}" ]]; then
exit 0
fi

# build CDK first to ensure it is on disk for SBT to pick up
(
cd cdk
./script/ci
)
## build CDK first to ensure it is on disk for SBT to pick up
#(
# cd cdk
# ./script/ci
#)

sbt clean compile test riffRaffUpload

0 comments on commit c158c7a

Please sign in to comment.