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

Replace circle CI with github actions #962

Merged
merged 72 commits into from
May 13, 2024
Merged

Conversation

helenb
Copy link
Member

@helenb helenb commented Nov 10, 2023

This MR moves from circle ci over to github actions. I have leant heavily on the set-up for torchbox at https://github.com/torchbox/wagtail-torchbox/blob/main/.github/workflows/test.yml

Tasks the CI covers

  • install npm dependencies
  • install python and poetry
  • lint front-end code
  • compile front-end code
  • lint back-end code
  • test back-end code and create coverage report
  • run isort, flake8 black and python tests.
  • deployment to staging, dev, and prod

Note this MR also includes a couple of fixes to issues reported by flake8.

Further possible to dos (perhaps in separate merge requests):

@helenb helenb requested a review from kevinhowbrook November 10, 2023 12:46
@codecov-commenter
Copy link

codecov-commenter commented Nov 10, 2023

Codecov Report

Attention: 37 lines in your changes are missing coverage. Please review.

Comparison is base (2658542) 52.41% compared to head (1b7fa94) 63.38%.
Report is 81 commits behind head on master.

❗ Current head 1b7fa94 differs from pull request most recent head c261bbf. Consider uploading reports for the commit c261bbf to get more accurate results

Files Patch % Lines
rca/utils/models.py 64.44% 16 Missing ⚠️
rca/programmes/utils.py 45.45% 6 Missing ⚠️
rca/editorial/models.py 50.00% 4 Missing ⚠️
rca/guides/models.py 33.33% 4 Missing ⚠️
rca/programmes/models.py 80.00% 4 Missing ⚠️
fabfile.py 0.00% 2 Missing ⚠️
rca/settings/base.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #962       +/-   ##
===========================================
+ Coverage   52.41%   63.38%   +10.97%     
===========================================
  Files         162      112       -50     
  Lines        7740     6416     -1324     
  Branches      176        0      -176     
===========================================
+ Hits         4057     4067       +10     
+ Misses       3556     2349     -1207     
+ Partials      127        0      -127     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

.github/workflows/ci.yaml Outdated Show resolved Hide resolved
Copy link
Collaborator

@kevinhowbrook kevinhowbrook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shaping up well Helen, fab work. I've left a few comments around a few things but looks like you are sailing through it :)

.github/workflows/ci.yaml Outdated Show resolved Hide resolved
.github/workflows/ci.yaml Outdated Show resolved Hide resolved
.github/workflows/ci.yaml Outdated Show resolved Hide resolved
.github/workflows/ci.yaml Outdated Show resolved Hide resolved
@kevinhowbrook
Copy link
Collaborator

Another thing to consider here is splitting out your actions, I think I mentioned that on the ticket but it might be worth doing before you look at deployments.

E.G, your ci.yml file could look like the following.
This would allow you to split the lining and testing out which is a bit more organised. It's not a standard thing, but sometimes nicer.

name: CI

on:
  pull_request:
  push:
    branches: [dev, staging, master]

jobs:
  lint:
    uses: ./.github/workflows/lint.yml

  test:
    uses: ./.github/workflows/test.yml

@kevinhowbrook
Copy link
Collaborator

Just a sidenote, but this PR should also remove https://github.com/torchbox/rca-wagtail-2019/tree/master/.circleci so when it get's merge circle isn't trying to deploy too

on:
push:
branches:
- main
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that needs to be master as our branch still has that name

@helenb
Copy link
Member Author

helenb commented Dec 18, 2023

Hi @kevinhowbrook, I think this is nearly ready to merge now, and I won't have any more time for this for the considerable future, so I am hoping this is in a state now where you can take it back over and get it deployed.

There are two things I haven't done, which I don't think are essential:

  • manual approval for deployments, which we need to use github environments for - I've added a link to a blog post about this in the MR description
  • setting up the docs in github pages - I think this could be a fairly quick MR for someone else to do

Note that now I have removed the circle ci config, I am getting an error reported by circle ci on this branch - presumably removing the circle ci setup would be part of the deployment process for this branch?

I have added back in the flake8 test and fixed the errors it was reporting.

I have added in the coverage tests using the same bash script as circleci was using - it seems to run OK, but it includes a $COVERAGE_TOKEN which may need adding to the the repo secrets - I am not sure where this is coming from.

@kevinhowbrook kevinhowbrook force-pushed the chore/github-actions branch from c261bbf to e63fe3b Compare May 13, 2024 11:51
@kevinhowbrook kevinhowbrook changed the title Draft: add GitHub actions Replace circle CI with github actions May 13, 2024
@kevinhowbrook kevinhowbrook added the on-dev Flag to state if this code is on the dev site label May 13, 2024
@kevinhowbrook kevinhowbrook merged commit 417245f into master May 13, 2024
6 of 7 checks passed
@kevinhowbrook kevinhowbrook deleted the chore/github-actions branch May 13, 2024 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on-dev Flag to state if this code is on the dev site
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants