BetterDevilChance/.github/workflows/ci.yml

77 lines
2.9 KiB
YAML
Raw Normal View History

name: CI
on: [push, pull_request]
jobs:
build_and_lint:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: npm
- name: Retrieve the cached "node_modules" directory (if present)
uses: actions/cache@v3
id: node-cache
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies (if the cached directory was not found)
if: steps.node-cache.outputs.cache-hit != 'true'
run: npm ci
- name: Test to see if the project compiles
run: bash build.sh
2023-05-17 22:36:23 -03:00
#- name: Perform automated checks
# run: bash lint.sh
# To enable publishing in CI, follow the instructions here:
# https://github.com/IsaacScript/isaac-steam-workshop-upload
# Then, uncomment the lines below.
#- name: Upload the mod to Steam Workshop (if this is a release commit)
# uses: IsaacScript/isaac-steam-workshop-upload@v2
# if: "contains(github.event.head_commit.message, 'chore: release') && github.event_name != 'pull_request'"
# with:
# mod_path: mod
# env:
# CONFIG_VDF_CONTENTS: ${{ secrets.CONFIG_VDF_CONTENTS }}
# To enable CI failure notifications over Discord:
# - Right click on a channel in Discord and select "Edit Channel".
# - Click on "Integrations" on the left menu.
# - Click on the "Create Webhook" button.
# - Click on the box for the new webhook that was created.
# - Change the name to "GitHub".
# - Change the image to: https://github.com/IsaacScript/isaacscript/raw/main/misc/github.png
# - Click on the "Save Changes" button at the bottom.
# - Click on the "Copy Webhook URL" button.
# - Go to the main page for your repository on GitHub.
# - Click on the "Settings" tab near the top.
# - Click on "Secrets and variables" in the left menu.
# - Click on "Actions" from the dropdown list.
# - Click on the "New repository secret" button in the top right.
# - For the "Name" box, use "DISCORD_WEBHOOK" (without the quotes).
# - For the "Secret" box, paste in the URL that was copied in the "Copy Webhook URL" step.
# - Click on the "Add secret" button.
# - Delete this comment and uncomment the lines below.
#discord:
# name: Discord Failure Notification
# needs: [build_and_lint]
# if: always() # This is needed to always run this job, even if the other jobs fail.
# runs-on: ubuntu-latest
# steps:
# - uses: technote-space/workflow-conclusion-action@v3
# - if: env.WORKFLOW_CONCLUSION != 'success' && env.WORKFLOW_CONCLUSION != 'cancelled'
# uses: sarisia/actions-status-discord@v1
# with:
# webhook: ${{ secrets.DISCORD_WEBHOOK }}
# status: ${{ env.WORKFLOW_CONCLUSION }}
# title: ""