Skip to content

Meaningless change to see if integration tests run #4

Meaningless change to see if integration tests run

Meaningless change to see if integration tests run #4

name: "Integration test"
# NOTE: We're just running the tests that require earthdata login here; we
# don't distinguish yet between unit and integration tests yet.
on:
pull_request_target:
# WARNING: This is _super dangerous_ without the access check below!!
# See: https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
types:
- "open"
- "synchronize"
push:
branches:
- "main"
- "development"
jobs:
test:
name: "Test"
runs-on: "ubuntu-latest"
steps:
- name: "Get user permissions"
id: "checkAccess"
uses: "actions-cool/check-user-permission@v2"
with:
require: "write"
username: "${{ github.triggering_actor }}"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: "Notify of permissions issue"
if: "steps.checkAccess.outputs.require-result == 'false'"
uses: "actions/github-script@v7"
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `👋 Thanks for reporting! Integration tests have been skipped
due to lack of permissions.\n\n**Maintainers: [Prevent pwn requests](https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/)!**
Please review this PR for suspicious changes (especially
to GitHub Actions workflows), then, if everything looks good, re-run the job at
URL:
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}`,
})
- name: "Check User Permission"
if: "steps.checkAccess.outputs.require-result == 'false'"
run: |
echo "${{ github.triggering_actor }} does not have permissions on this repo."
echo "Current permission level is ${{ steps.checkAccess.outputs.user-permission }}"
echo "Job originally triggered by ${{ github.actor }}."
echo "Please re-run this job as a user with at least 'write' permissions on this repo."
exit 1
- uses: "actions/checkout@v4"
with:
fetch-depth: 0
# WARNING: This is _super dangerous_ without the access check above!!
# See: https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
ref: "${{ github.event.pull_request.head.sha }}"
- uses: "./.github/actions/install-icepyx"
with:
python-version: "3.12"
- name: "Run tests"
env:
EARTHDATA_USERNAME: "${{ secrets.EARTHDATA_USERNAME }}"
EARTHDATA_PASSWORD: "${{ secrets.EARTHDATA_PASSWORD }}"
run: |
pytest icepyx/ --verbose --cov app \
icepyx/tests/test_behind_NSIDC_API_login.py \
icepyx/tests/test_auth.py
- name: "Upload coverage report"
uses: "codecov/codecov-action@v4.5.0"
with:
token: "${{ secrets.CODECOV_TOKEN }}"