Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup common workflows for all GH repositories (public/private) #3

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

CMCDragonkai
Copy link
Member

Description

We can reuse workflows defined here for all repos to avoid having to do so much repeat work when we are working on the workflows.

Issues Fixed

Tasks

  • 1. Setup workflows for library JS repos
  • 2. Setup workflows for native library JS repos
  • 3. Setup workflows for website apps
  • 4. Setup worfkflows for desktop/CLI apps

Final checklist

  • Domain specific tests
  • Full tests
  • Updated inline-comment documentation
  • Lint fixed
  • Squash and rebased
  • Sanity check the final build

@CMCDragonkai CMCDragonkai self-assigned this Dec 20, 2024
@CMCDragonkai
Copy link
Member Author

@brynblack @tegefaulkes

@CMCDragonkai
Copy link
Member Author

This is going to work for repositories that have the new lint.mjs script, that way we only need to do npm run lint for things to work.

@CMCDragonkai
Copy link
Member Author

So something I found is that the cobertura report is no longer properly generated. Actually coverage reports all just empty now. I actually don't remember when this was regressed on. It's possible that it has to do with the ESM changeover... right now not that important so skipping fixing this.

@CMCDragonkai
Copy link
Member Author

So the check test job should look like this:

  check-test:
    name: "Check / Test"
    runs-on: ubuntu-latest
    container:
      image: ghcr.io/matrixai/github-runner
    steps:
      - uses: actions/checkout@v4
      - name: Run tests
        run: |
          nix develop .#ci --command bash -c $'
          npm run test -- --ci --coverage
          '
      - name: Upload JUnit report
        if: success() || failure()
        uses: actions/upload-artifact@v4
        with:
          name: junit-report
          path: tmp/junit/junit.xml
      - name: Publish JUnit Report
        uses: mikepenz/action-junit-report@v5
        with:
          report_paths: tmp/junit/junit.xml
      - name: Upload Cobertura report
        if: success() || failure()
        uses: actions/upload-artifact@v4
        with:
          name: coverage-report
          path: tmp/coverage/cobertura-coverage.xml

Here we can see we needed to add the if: success() || failure() to ensure that the subsequent jobs run even if the test fails which is important for junit reports and coverage reports.

I also added the JUnit report processor as we no longer have that automatic like in gitlab.

@CMCDragonkai
Copy link
Member Author

CMCDragonkai commented Dec 20, 2024

So I have 3 jobs in the feature branch for library JS repos:

  • check-lint
  • check-test
  • check-build

The check-build is a "feature" job that runs to sanity check that the build works.

However we don't keep around the artifact do we? I guess it would depend on what is being built. That would be a the dist directory for library code. Whereas for the SSG websites that's the public directory.

@CMCDragonkai
Copy link
Member Author

Ok so I've got library-js-feature.yml in .github. I want to test this for now to see if I have it properly setup. I want to test it in js-contexts under the feature-ci branch.

We will see if it we can reference it properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant