Merge pull request #18 from codecov/update-to-v5 #550
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Github Actions Java Standard | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
standard-upload: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.STANDARDS_TOKEN }} | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
- name: Before Install | |
run: | | |
pip install requests | |
chmod +x gradlew | |
chmod +x gradle/wrapper/gradle-wrapper.jar | |
- name: Run tests | |
run: | | |
./gradlew build | |
./gradlew test | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} | |
- name: Check coverage | |
run: python request.py | |
env: | |
API_KEY: ${{ secrets.API_KEY }} | |
EXPECTED_COVERAGE: ${{ secrets.EXPECTED_COVERAGE }} | |
- name: Upstream to Standards | |
env: | |
GH_TOKEN: ${{ secrets.STANDARDS_TOKEN }} | |
COVERAGE_SOURCE_FILE: ${{ secrets.COVERAGE_SOURCE_FILE }} | |
if: ${{ github.event_name == 'push'}} | |
run: | | |
wget --header "Authorization: token ${GH_TOKEN}" \ | |
--header "Accept: application/vnd.github.v3.raw" \ | |
https://api.github.com/repos/codecov/standards/contents/upstream.sh | |
bash upstream.sh |