Skip to content

Commit

Permalink
ci: improve gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
inigomarquinez committed Nov 22, 2024
1 parent 8b00272 commit cb3268c
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 30 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ updates:
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: ".github/workflows"
schedule:
interval: "weekly"
34 changes: 20 additions & 14 deletions .github/workflows/code-climate-test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Code Climate Test Reporter
on:
push:
branches: [main]
# pull_request:
# branches: [main]

permissions: # added using https://github.com/step-security/secure-workflows
contents: read
Expand All @@ -14,20 +12,28 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af #v4.1.0
with:
node-version: '18.x'
- run: npm ci
- run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- run: chmod +x ./cc-test-reporter
- run: ./cc-test-reporter before-build
- run: npm run coverage
- run: ./cc-test-reporter format-coverage -t lcov coverage/lcov.info
- run: ./cc-test-reporter upload-coverage
node-version: 18
- name: Install dependencies
run: npm ci
- name: Test Reporter
run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- name: Make Test Reporter executable
run: chmod +x ./cc-test-reporter
- name: Before Build
run: ./cc-test-reporter before-build
- name: Coverage
run: npm run coverage
- name: Format Coverage
run: ./cc-test-reporter format-coverage -t lcov coverage/lcov.info
- name: Upload Coverage
run: ./cc-test-reporter upload-coverage
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
19 changes: 9 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
env:
ENVIRONMENT: ${{ vars.ENVIRONMENT }}
AWS_REGION: ${{ vars.AWS_REGION }}
Expand All @@ -24,14 +21,16 @@ jobs:
SLACK_BANK_HOLIDAYS_CHANNEL_IDS: ${{ vars.SLACK_BANK_HOLIDAYS_CHANNEL_IDS }}
SLACK_OFFICE_CHANNEL_IDS: ${{ vars.SLACK_OFFICE_CHANNEL_IDS }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af #v4.1.0
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- name: serverless deploy
uses: serverless/github-action@v3.1
node-version: 18
- name: Install dependencies
run: npm ci
- name: Deploy
uses: serverless/github-action@189dd6854a3b12ecff4a02c49351779f919933ca #v3.2.0
with:
args: deploy

16 changes: 10 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ jobs:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af #v4.1.0
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run lint
- run: npm test
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Test
run: npm test

0 comments on commit cb3268c

Please sign in to comment.