Skip to content

Commit

Permalink
Automate update ref tests (#2409)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosholgado authored Oct 17, 2022
1 parent 62daa69 commit 5747422
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-debug-apk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
branches:
- develop
paths-ignore:
- '**.md'
- '.github/**'
workflow_dispatch:

concurrency:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ on:
- develop
paths-ignore:
- '**.md'
- '.github/**'
pull_request:
paths-ignore:
- '**.md'
- '.github/**'

concurrency:
group: ${{ github.head_ref || github.ref_name }}
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/update-ref-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Update Reference Tests

on:
schedule:
- cron: '0 1 * * *' # run at 1 AM UTC
workflow_dispatch:

concurrency:
group: ${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

jobs:
update-ref-tests:
name: Update reference tests
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive

- name: Install npm-check-updates
run: npm install -g npm-check-updates

- name: Install copy-files-from-to
run: npm install -g copy-files-from-to

- name: Check for updates
id: update-check
continue-on-error: true
run: ncu @duckduckgo/privacy-reference-tests --errorLevel 2

- name: Update reference tests
if: ${{ steps.update-check.outcome == 'failure' }}
run: ncu @duckduckgo/privacy-reference-tests -u

- name: Install package
if: ${{ steps.update-check.outcome == 'failure' }}
run: npm install

- name: Copy files
if: ${{ steps.update-check.outcome == 'failure' }}
run: copy-files-from-to

- name: Create PR
if: ${{ steps.update-check.outcome == 'failure' }}
uses: peter-evans/create-pull-request@v4
with:
base: "develop"
title: "Update reference tests to latest version"
author: daxmobile <[email protected]>
token: ${{ secrets.GT_DAXMOBILE }}
commit-message: "Update reference tests to latest version"
labels: reference tests, automated pr
branch: automated/update-ref-tests-dependencies
body: |
- Automated reference tests dependency update
This PR updates the reference tests dependency to the latest available version and copies the necessary files.
- [ ] All tests must pass

0 comments on commit 5747422

Please sign in to comment.