Implement safe_to_test label and update outdated github actions in github_actions.yml

This commit is contained in:
zinduolis
2026-03-02 15:38:36 +10:00
parent b36c502ec5
commit 8a400906ae

View File

@@ -3,17 +3,28 @@ name: 'BrowserStack Test'
on: on:
pull_request_target: pull_request_target:
branches: [ master ] branches: [ master ]
types: [ labeled ]
jobs:
jobs:
ubuntu-job: ubuntu-job:
name: 'BrowserStack Test on Ubuntu' name: 'BrowserStack Test on Ubuntu'
runs-on: ubuntu-latest # Can be self-hosted runner also runs-on: ubuntu-latest
environment: if: github.event.label.name == 'safe_to_test'
name: Integrate Pull Request env:
env:
GITACTIONS: true GITACTIONS: true
steps: steps:
- name: 'Remove safe_to_test label'
uses: actions/github-script@v8
with:
script: |
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
name: 'safe_to_test'
});
- name: 'BrowserStack Env Setup' # Invokes the setup-env action - name: 'BrowserStack Env Setup' # Invokes the setup-env action
uses: browserstack/github-actions/setup-env@master uses: browserstack/github-actions/setup-env@master
with: with:
@@ -27,7 +38,7 @@ jobs:
local-identifier: random local-identifier: random
- name: 'Checkout the repository' - name: 'Checkout the repository'
uses: actions/checkout@v4 uses: actions/checkout@v6
with: with:
ref: ${{ github.event.pull_request.head.sha }} ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2 fetch-depth: 2
@@ -40,11 +51,13 @@ jobs:
run: | run: |
sudo apt update sudo apt update
sudo apt install libcurl4 libcurl4-openssl-dev sudo apt install libcurl4 libcurl4-openssl-dev
- name: 'Configure Bundle testing and install gems' - name: 'Configure Bundle testing and install gems'
run: | run: |
bundle config unset --local without bundle config unset --local without
bundle config set --local with 'test' 'development' bundle config set --local with 'test' 'development'
bundle install bundle install
- name: 'Run BrowserStack simple verification' - name: 'Run BrowserStack simple verification'
run: | run: |
bundle exec rake browserstack --trace bundle exec rake browserstack --trace