Skip to content

Commit

Permalink
Merge pull request #905 from Ana06/failed_new_package_CI
Browse files Browse the repository at this point in the history
[CI] Test automated new package before PR
  • Loading branch information
Ana06 authored Feb 21, 2024
2 parents 9576e45 + 3cceab4 commit 1854054
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/new_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
create-package:
runs-on: ubuntu-latest
runs-on: windows-2022
if: github.event.label.name == 'send PR'
steps:
- name: Remove 'send PR' label
Expand All @@ -22,19 +22,24 @@ jobs:
template-path: .github/ISSUE_TEMPLATE/new_package.yml
- name: Write issue JSON string to tmp file
run: |
echo $JSON_STRING > pkg.json
echo $env:JSON_STRING > pkg.json
cat pkg.json
env:
JSON_STRING: ${{ steps.issue-parser.outputs.jsonString }}
- name: Create and commit package
- name: Create package
run: |
# The Python script prints the package name so that we can easily
# echo it to $GITHUB_ENV. Alternatively we could parse if with a
# regular string from the JSON string
pkg_name=$(./scripts/utils/create_package_template_from_json.py --json_file pkg.json)
echo "pkg_name=$pkg_name" >> $GITHUB_ENV
# The Python script prints the package name so that we can add it to GITHUB_ENV
$pkg_name = $(python scripts/utils/create_package_template_from_json.py --json_file pkg.json)
echo "pkg_name=$pkg_name" >> $env:GITHUB_ENV
- name: Build and test new package
id: test
run: scripts/test/test_install.ps1 "$env:pkg_name.vm"
- name: Upload logs to artifacts
uses: ./.github/actions/upload-logs
if: always()
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
if: steps.test.outcome == 'success'
with:
title: ':robot: Add ${{env.pkg_name}}.vm'
body: 'Automated PR from ${{github.event.issue.html_url}} :rocket:'
Expand Down

0 comments on commit 1854054

Please sign in to comment.