Commit Graph

57 Commits

Author SHA1 Message Date
Alex
8ce82a9ad6 build: harden mapi.yml permissions
Signed-off-by: Alex <aleksandrosansan@gmail.com>
2022-09-23 22:52:16 +02:00
Alex
bd6bf9315a build: harden linters.yml permissions
Signed-off-by: Alex <aleksandrosansan@gmail.com>
2022-09-23 22:51:33 +02:00
filipefurtad0
ba8162c1d0 Splits consumer specs into two parallel runs 2022-09-15 17:34:01 +01:00
filipefurtad0
bf1fc736b9 Removes _spec.rb ending from admin specs on build.yml 2022-09-15 17:32:48 +01:00
Maikel
dd2e77a244 Merge pull request #9557 from jibees/9555-update-the-build-env
Update the build env. from ubuntu-18.04 to ubuntu-20.04
2022-09-07 13:43:42 +10:00
Jean-Baptiste Bellet
24fc941b4c Update the build env. from ubuntu-18.04 to ubuntu-20.04 2022-09-06 10:28:26 +02:00
filipefurtad0
be021f4697 Removes spec/features from the build-run 🎉 2022-08-17 23:25:02 +01:00
Jean-Baptiste Bellet
c6884f96e1 Add prettier as a GH action 2022-08-08 14:40:58 +10:00
Maikel Linke
1e13d579ba Run Mayhem for API only when triggered manually
It currently always fails and we are not using it. We may use it in the
future though and the results can be interesting. So I'm keeping it but
it's not triggered on every pull request. How to trigger:

https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow#running-a-workflow
2022-07-21 10:37:58 +10:00
neilnaveen
5c1bdc7698 chore: Set permissions for GitHub actions
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
2022-06-16 01:08:27 +00:00
Maikel
44965ff235 Fix MAPI conditional on master 2022-05-09 12:35:52 +10:00
Maikel Linke
ec7d7b0ad8 Fix workflow conditional 2022-05-05 14:22:39 +10:00
Maikel Linke
2758f83a2a Run Mayhem4API only within organisation
The API key is not accessible outside.
2022-05-05 12:10:08 +10:00
J. David Lowe
ff1b895286 switch to openfoodfoundation 2022-04-28 14:42:24 -07:00
J. David Lowe
da2e7b404f add Mayhem for API as a github workflow 2022-04-28 13:30:34 -07:00
Matt-Yorkley
3418e5282a Use our defined rubocop version on CI
The default is to use the latest version. That's often fine because we
keep our version up-to-date but it may not always be. It's also great if
builds are re-producible.
2022-02-14 15:56:18 +11:00
filipefurtad0
b25e0ed87b Deletes spec/features/consumer folder 2021-12-20 15:13:57 +00:00
filipefurtad0
e0006a6dc4 Removes build line related to feature specs 2021-12-03 10:54:28 +00:00
Matt-Yorkley
e533973ecd Merge pull request #8513 from jibees/run-rubocop-with-reviewdog
Run rubocop with reviewdog
2021-12-02 21:14:04 +00:00
Adrien Chauve
8585c68691 Remove occurences of application.yml.example 2021-12-01 18:39:26 +01:00
Jean-Baptiste Bellet
1f74ded192 run rubocop view reviewdog 2021-11-24 09:25:42 +01:00
Matt-Yorkley
6635b59250 Split admin system tests into two groups 2021-11-11 14:49:03 +00:00
Matt-Yorkley
1ad1e51bb6 Break up system tests into two jobs 2021-10-29 12:00:45 +01:00
Maikel
40aac6a21b Merge pull request #8386 from jibees/download-artifact
Archive failed tests screenshots
2021-10-27 14:03:49 +11:00
filipefurtad0
1ecf3bd78f Updates workflow - don't call admin subderictories 2021-10-25 12:35:33 +01:00
Jean-Baptiste Bellet
665566c28c Archive failed tests screenshots 2021-10-21 09:50:04 +02:00
Maikel Linke
61333a958e Continue all jobs when one failed
It's nice to see the whole result to then work on all failures,
especially when there are flaky specs.
2021-10-19 09:15:51 +11:00
Maikel Linke
9ccb744ef3 Remove superfluous env parameter
It's already defined globally.
2021-10-19 09:15:51 +11:00
Maikel Linke
a4db3b675d DRY actions config with matrix syntax
This uses the matrix syntax for all rspec calls. It is easier to
maintain than the previous list of GH Actions workflows.

The execution of the rspec rake task is still in its own job because it
doesn't fit in the same pattern. The JS tests are also executed in that
job.
2021-10-19 09:15:51 +11:00
Maikel Linke
d6c216840e Use matrix to split jobs
This demonstrates how you can split the tests across multiple jobs
without repeating the job configuration. This has a lot of potential to
DRY our config.
2021-10-19 09:15:51 +11:00
Matt-Yorkley
ef02197bab Remove Codecov upload tasks 2021-09-08 10:48:28 +01:00
Matt-Yorkley
54987dd622 Merge pull request #8099 from jibees/8097-test-stimulus
Add jest and stimulusjs testing
2021-09-03 16:16:16 +02:00
Jean-Baptiste Bellet
149c0d4de4 Add yarn jest to the github workflow 2021-09-03 14:14:25 +02:00
Matt-Yorkley
0459071ce3 Set RAILS_ENV=test in test suite 2021-09-02 17:29:26 +01:00
Matt-Yorkley
94e476d21f Run system tests in their own action 2021-07-21 18:58:28 +01:00
Matt-Yorkley
99035a250b Move Rspec retries count to CI config and remove in local environment
When running tests locally we want them to fail immediately

Reference: https://github.com/NoRedInk/rspec-retry#environment-variables
2021-06-21 11:21:11 +01:00
Maikel Linke
90bb9870ab Bump Codecov from 1.3.1 to 1.5.0 2021-05-20 14:17:36 +10:00
Matt-Yorkley
c702b398d6 Add warning comment on migration test isolation 2021-04-04 19:19:06 +01:00
Matt-Yorkley
3092397346 Isolate migration tests 2021-04-04 19:19:06 +01:00
Pau Perez
b2840aaebf Enable coverage in CI and use Codecov formatter 2021-03-31 10:02:50 +02:00
Pau Perez
756b3a6ee5 Upload coverage report after every CI job 2021-03-31 08:56:58 +02:00
Andy Brett
2fbc5afce6 add rake task to catch all subfolders under /spec 2021-03-22 16:18:19 -07:00
Andy Brett
f021e5e074 add --profile to all jobs 2021-03-22 09:37:03 -07:00
Andy Brett
8cc6e60ed1 include specs that start with numbers 2021-03-22 09:31:52 -07:00
Andy Brett
5cbd37f112 reorder jobs and move to 7 jobs 2021-03-21 14:55:53 -07:00
Andy Brett
c298aa19fa rebalance CI jobs 2021-03-19 10:48:18 -07:00
Andy Brett
f9f1bf8331 specify UTC explicitly 2021-03-16 12:00:20 -07:00
Pau Perez
e952664a14 Run build on pull_request event
As is, we're seeing builds almost only on merge commits and not on
others. Also, the build status is not displayed at the bottom of the
PR.

Once we see this fixed and have a better understanding, we can decide
whether or not we remove the `push` event. I guess both we'll be needed.
2021-03-15 20:06:15 +01:00
Andy Brett
89e0fd8f0a combine model jobs 2021-03-13 10:30:15 -08:00
Pau Perez
8301f2d550 Output RSpec profiling data
This shows things like:

```
Top 10 slowest examples (32.34 seconds, 87.1% of total time):

  As a site administrator
  I want to configure the site content
 fills in a setting shows the result on the home page
    19.12 seconds ./spec/features/admin/configuration/content_spec.rb:17
  States creating and editing states should allow an admin to edit existing states
    7.36 seconds ./spec/features/admin/configuration/states_spec.rb:40
  Tax Rates while editing can be deleted
    1.22 seconds ./spec/features/admin/configuration/tax_rates_spec.rb:58
  States creating and editing states should allow an admin to create states for non default countries
    1.16 seconds ./spec/features/admin/configuration/states_spec.rb:52
  States creating and editing states should show validation errors
    1 seconds ./spec/features/admin/configuration/states_spec.rb:68
  Zones edit existing zone
    0.90067 seconds ./spec/features/admin/configuration/zones_spec.rb:42
```

and

```
Top 8 slowest example groups:

  As a site administrator
  I want to configure the site content
    6.64 seconds average (19.93 seconds / 3 examples) ./spec/features/admin/configuration/content_spec.rb:5
  States
    2.42 seconds average (9.68 seconds / 4 examples) ./spec/features/admin/configuration/states_spec.rb:5
  Tax Rates
    0.51138 seconds average (2.56 seconds / 5 examples) ./spec/features/admin/configuration/tax_rates_spec.rb:4
  Zones
    0.49488 seconds average (1.48 seconds / 3 examples) ./spec/features/admin/configuration/zones_spec.rb:5
  Tax Categories
    0.32438 seconds average (1.3 seconds / 4 examples) ./spec/features/admin/configuration/tax_categories_spec.rb:5
  Taxonomies
    0.30578 seconds average (1.22 seconds / 4 examples) ./spec/features/admin/configuration/taxonomies_spec.rb:5
  General Settings
    0.28868 seconds average (0.57737 seconds / 2 examples) ./spec/features/admin/configuration/general_settings_spec.rb:5
  Mail Methods
    0.26415 seconds average (0.26415 seconds / 1 example) ./spec/features/admin/configuration/mail_methods_spec.rb:5

Finished in 37.11 seconds (files took 6.27 seconds to load)
26 examples, 0 failures
```

which is essential to speed up our test suite.
2021-03-09 16:22:46 +01:00