diff options
| author | Jack Koenig | 2021-04-15 16:45:38 -0700 |
|---|---|---|
| committer | GitHub | 2021-04-15 16:45:38 -0700 |
| commit | fc86112bc09f3e804d76e329fea96acb70e4909d (patch) | |
| tree | 190a34868880b72d3153e487d1eafafd9620c258 /.github | |
| parent | 20890bbd6bef2f33adace433a2d01f89458f0466 (diff) | |
Add Workflow to automatically update .mergify.yml (#2180)
Also make minor updates to CI workflow
Diffstat (limited to '.github')
| -rw-r--r-- | .github/configs/mergify_config.yml | 7 | ||||
| -rw-r--r-- | .github/workflows/test.yml | 4 | ||||
| -rw-r--r-- | .github/workflows/update_mergify.yml | 53 |
3 files changed, 62 insertions, 2 deletions
diff --git a/.github/configs/mergify_config.yml b/.github/configs/mergify_config.yml new file mode 100644 index 00000000..90bf4ad5 --- /dev/null +++ b/.github/configs/mergify_config.yml @@ -0,0 +1,7 @@ +# Configuration for generating .mergify.yml +conditions: + - status-success=all tests passed +branches: + - 1.2.x + - 1.3.x + - 1.4.x diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4e0c8125..d04f7e05 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,7 @@ jobs: with: java-version: adopt@1.8 - name: Cache Scala - uses: coursier/cache-action@v5 + uses: coursier/cache-action@v6 - name: Check Formatting (Scala 2.12 only) if: startsWith(matrix.scala, '2.12') run: sbt ++${{ matrix.scala }} scalafmtCheckAll @@ -95,7 +95,7 @@ jobs: # When adding new jobs, please add them to `needs` below all_tests_passed: name: "all tests passed" - needs: [test, equiv] + needs: [test, mill, equiv] runs-on: ubuntu-latest steps: - run: echo Success! diff --git a/.github/workflows/update_mergify.yml b/.github/workflows/update_mergify.yml new file mode 100644 index 00000000..d2067a42 --- /dev/null +++ b/.github/workflows/update_mergify.yml @@ -0,0 +1,53 @@ +name: Update .mergify.yml +on: + schedule: + # Runs once an hour + - cron: "0 * * * *" + +jobs: + update-mergify: + name: Update .mergify.yml + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Checkout Chisel Repo Tools + uses: actions/checkout@v2 + with: + repository: ucb-bar/chisel-repo-tools + path: tools + - name: Setup Scala + uses: olafurpg/setup-scala@v10 + - name: Install Ammonite + run: sudo sh -c '(echo "#!/usr/bin/env sh" && curl -L https://github.com/com-lihaoyi/Ammonite/releases/download/2.3.8/2.13-2.3.8) > /usr/local/bin/amm && chmod +x /usr/local/bin/amm' + - name: Cache Scala + uses: coursier/cache-action@v6 + - name: Generate .mergify.yml + id: gen + run: | + ./tools/scripts/mergify.sc .github/configs/mergify_config.yml > .mergify.yml + diff=$(git diff -- .mergify.yml) + echo "::set-output name=diff::$diff" + - name: Commit and Push + if: ${{ steps.gen.outputs.diff }} + run: | + BRANCH="actions/workflows/update-mergify" + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git checkout -B $BRANCH + git add .mergify.yml + git commit -m "Update .mergify.yml" + git push --follow-tags --force --set-upstream origin $BRANCH + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Open/Update Pull Request + if: ${{ steps.gen.outputs.diff }} + uses: vsoch/pull-request-action@1.0.15 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PULL_REQUEST_FROM_BRANCH: actions/workflows/update-mergify + PULL_REQUEST_BRANCH: master + PULL_REQUEST_TITLE: "Update .mergify.yml" + PULL_REQUEST_BODY: "This is an automated pull request by \"Update .mergify.yml\" workflow" + PASS_IF_EXISTS: true + |
