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

CI: Build main on push, run tests. Maybe static code analysis #3

Closed
phildenhoff opened this issue Jan 14, 2024 · 2 comments
Closed
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@phildenhoff
Copy link
Member

To make it easier to try Citadel, and ensure that new changes don't prevent the app from working for long, add a CI pipeline using GitHub Actions to build main anytime it's updated, and run any tests.

The build should be a matrix supporting

  • Ubuntu/Debian builds
  • macOS

In the future, if there is appeal, we can add Windows builds + non-appimage/.deb builds.

Stretch goal

Add a CI pipeline that, on PR open or updated, runs static checks like linting & formatting checks (ensure code is correctly formatted). I haven't run these in a while, so there are likely to be some errors. The first step is to open a PR that resolves any lint/format issues without adding CI.

Further reading

@phildenhoff phildenhoff added enhancement New feature or request good first issue Good for newcomers labels Jan 15, 2024
@phildenhoff
Copy link
Member Author

Thanks to @danielfrankcom, here's a Dockerfile to build appimage & .deb files

ARG WORKDIR=/build
 
FROM ivangabriele/tauri:fedora-37-18 AS build
 
ARG WORKDIR
WORKDIR ${WORKDIR}
 
RUN curl -fsSL https://bun.sh/install | bash 
ENV PATH="${PATH}:/root/.bun/bin/"
 
COPY package.json bun.lockb "${WORKDIR}"
RUN bun install --frozen-lockfile
 
COPY . "${WORKDIR}"
RUN bun run build
 
FROM scratch AS artifacts
 
ARG WORKDIR
COPY --from=build \
    "${WORKDIR}/src-tauri/target/release/bundle/appimage/citadel_0.1.0_amd64.AppImage" \
    .
COPY --from=build \
    "${WORKDIR}/src-tauri/target/release/bundle/deb/citadel_0.1.0_amd64.deb" \
    .

@phildenhoff
Copy link
Member Author

I've set up a very rough CI process that builds on pushes to main (and PRs, although uploads should be disabled for those), uploads the artifacts to the Action, and creates a Draft release. I'm open to feedback / changes here, because I don't like it, but something is better than nothing.

Specifically:

  • is it easy to access artifacts from GH actions?
  • do we really need a release for every push to main? I think not. A manual "this build is good" process could create that release.
  • PRs should build the app but not publish the artifacts, esp. not as a new Release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant