Skip to content

Grimoirize Yachtzee #5013

Grimoirize Yachtzee

Grimoirize Yachtzee #5013

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source
# code across multiple Node.js versions, and lint the project.
name: Build & Lint
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
# Default version of Node.js for jobs
node-version: "18"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn run check
#- run: yarn run test TODO: Readd once we have tests
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn run lint
circular:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn run madge
verify-build:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn run build
build:
runs-on: ubuntu-latest
needs: [test, lint, circular]
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
cache: yarn
- run: |
git config user.name "O.A.F."
git config user.email "<>"
- run: |
cp -R mafia mafiafiles
- run: yarn install --frozen-lockfile
- run: yarn run build
- run: |
git fetch --all
git switch release
rm -r scripts/
rm -r data/
rm -r relay/
rm -r images/
mv KoLmafia/scripts scripts
mv KoLmafia/relay relay
mv mafiafiles/data ./data
mv mafiafiles/dependencies.txt dependencies.txt
mv mafiafiles/images ./images
- env:
MESSAGE: ${{github.event.commits[0].message}}
run: |
git add scripts/
git add data/
git add relay/
git add images/
git add dependencies.txt
{
git commit -m "$MESSAGE"
git push origin release
} || exit 0