2023 Refresh #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
tests: | |
runs-on: [self-hosted, Linux, AWS] | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout code | |
uses: Brightspace/third-party-actions@actions/checkout | |
- name: Setup node | |
uses: Brightspace/third-party-actions@actions/setup-node | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- name: Add CodeArtifact npm registry | |
uses: Brightspace/codeartifact-actions/npm/add-registry@main | |
with: | |
auth-token: ${{secrets.CODEARTIFACT_AUTH_TOKEN}} | |
- name: Install node modules | |
run: npm ci | |
- name: Lint and license check | |
run: | | |
npm run lint | |
npm run test:license | |
- name: Run Tests | |
run: npm run test | |
release: | |
runs-on: [ self-hosted, Linux, AWS ] | |
timeout-minutes: 10 | |
if: github.ref == 'refs/heads/master' | |
needs: tests | |
steps: | |
- name: Checkout code | |
uses: Brightspace/third-party-actions@actions/checkout | |
with: | |
persist-credentials: false | |
- name: Setup node | |
uses: Brightspace/third-party-actions@actions/setup-node | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- name: Add CodeArtifact npm registry | |
uses: Brightspace/codeartifact-actions/npm/add-registry@main | |
with: | |
auth-token: ${{secrets.CODEARTIFACT_AUTH_TOKEN}} | |
- name: Install node modules | |
run: npm ci | |
- name: Lint, License Check and Generate Types | |
run: | | |
npm run lint | |
npm run test:license | |
- name: Get CodeArtifact Authorization Token | |
uses: Brightspace/codeartifact-actions/get-authorization-token@main | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }} | |
- name: Semantic Release | |
uses: BrightspaceUI/actions/semantic-release@main | |
with: | |
DEFAULT_BRANCH: master | |
GITHUB_TOKEN: ${{ secrets.D2L_GITHUB_TOKEN }} | |
NPM: true | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |