CI by @jaswrks #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
## | |
# GitHub CI workflow. | |
# | |
# GitHub is aware of this config file's location. | |
# | |
# @note CUSTOM EDITS ONLY PLEASE! | |
# @note In the future this file will be updated automatically. | |
# @note Only `<custom:start.../custom:end>` will be preserved below. | |
## | |
name: 'CI' # <https://o5p.me/QsaIUU> | |
run-name: 'CI by @${{github.actor}}' | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
branches: | |
- 'main' | |
workflow_dispatch: | |
concurrency: | |
cancel-in-progress: true | |
group: ${{github.workflow}}-${{github.ref}} | |
jobs: | |
deployment: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [19.1.0, 20.5.1] | |
runs-on: ${{matrix.os}} | |
environment: ci # CI environment. | |
permissions: # GitHub token permissions. | |
contents: read # Mininum requirements. | |
env: # Supplied by permissions above. | |
USER_GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
# Supplied by org-wide action secrets. | |
USER_NPM_TOKEN: ${{secrets.USER_NPM_TOKEN}} | |
# Supplied by repo environment secrets. | |
USER_DOTENV_KEY_MAIN: ${{secrets.USER_DOTENV_KEY_MAIN || ''}} | |
USER_DOTENV_KEY_CI: ${{secrets.USER_DOTENV_KEY_CI || ''}} | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Setup Node v${{matrix.node-version}} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{matrix.node-version}} | |
cache: npm # Cache NPM dependencies. | |
- name: Install Project | |
shell: bash | |
run: | | |
npx @clevercanyon/madrun install project --mode=ci; | |
- name: Run Project Tests | |
shell: bash | |
run: | | |
npx @clevercanyon/madrun tests --mode=ci; | |
# | |
## | |
# Customizations | |
# <custom:start> | |
# </custom:end> |