feat: attach to request rhda-token if exists in env/option #129
Workflow file for this run
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: Pull request build | |
on: | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
name: Lint and test project | |
strategy: | |
matrix: | |
node: ['18', 'latest'] | |
env: | |
MAIN_NODE_VER: '18' | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
- name: Install node ${{ matrix.node }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: npm | |
- name: Setup Java 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
cache: maven | |
- name: setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
cache: 'pip' | |
- name: get Python location | |
id: python-location | |
run: | | |
echo "python-bin-location=$(echo $pythonLocation)/bin" >> $GITHUB_OUTPUT | |
- name: Install project modules | |
run: npm ci | |
- name: Lint source files | |
run: npm run lint | |
- name: Run unit tests | |
env: | |
EXHORT_PYTHON3_PATH: "${{steps.python-location.outputs.python-bin-location}}/python3" | |
EXHORT_PIP3_PATH: "${{steps.python-location.outputs.python-bin-location}}/pip3" | |
run: npm run test | |
- name: Compile project | |
run: npm run compile | |
- name: Run integration tests | |
working-directory: integration | |
run: EXHORT_ITS_USE_REAL_API=true bash ./run_its.sh | |
- name: Upload coverage reports | |
if: ${{ matrix.node == env.MAIN_NODE_VER }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage | |
path: ./coverage/coverage-final.json |