0xFableOrg / 0xFable

A fully on-chain trading card game. There will be elves, wizards & shit. Drama and broken friendships also.
https://twitter.com/0xFableGame
BSD 3-Clause Clear License
103 stars 35 forks source link

Add github CI checks for linting #125

Closed ptisserand closed 5 months ago

ptisserand commented 5 months ago

Context (Problem, Motivation, Solution)

This PR add a github CI workflow which will run make check Closes #119

Describe Your Changes

Checklist

Testing

I have tested using https://github.com/nektos/act

norswap commented 5 months ago

Fantastic, let's merge it!

norswap commented 5 months ago

Ayoo, it fails: https://github.com/0xFableOrg/0xFable/actions/runs/8000911253

Type error: Cannot find module 'contracts/out/deployment.json' or its corresponding type declarations.

This makes perfect sense. We either need to commit a dummy deployment file to the repo, or run Anvil and deploy in the action itself.

Actually, I suggest adding a command to the github action that simply creates an empty JSON (file containing {}) at contracts/out/deployment.json. That seems like the easiest way out of this.

We're also getting this (unrelated) warning:

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

We need to update the foundry-toolchain action to the latest version.

Finally, I suggest testing the action in a github fork, as clearly local testing is not perfect ;)

norswap commented 5 months ago

I forced-pushed the merge away, so as not to bother the other PRs with failed CI runs.

ptisserand commented 5 months ago

Type error: Cannot find module 'contracts/out/deployment.json' or its corresponding type declarations.

This makes perfect sense. We either need to commit a dummy deployment file to the repo, or run Anvil and deploy in the action itself.

Actually, I suggest adding a command to the github action that simply creates an empty JSON (file containing {}) at contracts/out/deployment.json. That seems like the easiest way out of this.

I have fixed this issue with adding the following step:

      - name: Fake contract deploymment
        run: mkdir -p packages/contracts/out && echo "{}" > packages/contracts/out/deployment.json

We're also getting this (unrelated) warning:

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

We need to update the foundry-toolchain action to the latest version.

We are already using the latest foundry-toolchain action, I have updated actions/checkout to fix this warning: https://github.com/ptisserand/0xFable/actions/runs/8013673319

Finally, I suggest testing the action in a github fork, as clearly local testing is not perfect ;) Sure, sorry for this mistake.

@norswap Should I create a new PR ?

norswap commented 5 months ago

We are already using the latest foundry-toolchain action

Are you sure? This specifies v1 but latest version is v1.1.1, and v1.1 moves version to Node 16 to Node 20. Not sure if these versions are wildcards.

@norswap Should I create a new PR ?

Yes please :)

ptisserand commented 5 months ago

We are already using the latest foundry-toolchain action

Are you sure? This specifies v1 but latest version is v1.1.1, and v1.1 moves version to Node 16 to Node 20. Not sure if these versions are wildcards.

v1 is a "moving tag", it's the same changeset as v1.1.1

@norswap Should I create a new PR ?

Yes please :)

Here is link to the new PR: https://github.com/0xFableOrg/0xFable/pull/127