Skip to content

Commit

Permalink
minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
amtoine committed Nov 13, 2023
1 parent 2b08060 commit 01b971d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
10 changes: 5 additions & 5 deletions .github/actions/setup_nupm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ outputs:
nupm_path:
value: ${{ steps.set-output.outputs.nupm-path }}
description: 'The path to the installed Nupm'

runs:
using: composite
steps:
Expand All @@ -19,10 +20,10 @@ runs:

- name: Show Nushell Version
run: version
shell: "nu {0}"
shell: nu {0}

- run: "git clone --depth 1 https://github.com/nushell/nupm /tmp/nupm"
shell: "nu {0}"
- run: git clone --depth 1 https://github.com/nushell/nupm /tmp/nupm
shell: nu {0}

- run: |
use /tmp/nupm/nupm
Expand All @@ -31,6 +32,5 @@ runs:
nupm install --force --path /tmp/nupm
}
$env.GITHUB_OUTPUT = 'nupm-path="/tmp/nupm"'
shell: "nu {0}"
shell: nu {0}
id: set-output
7 changes: 3 additions & 4 deletions .github/actions/sync_action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ inputs:
description: 'Whether to push changes after syncing'
required: true
default: 'false'


runs:
using: 'composite'
steps:
- name: "Fetching from origin"
run: |
run: |
git fetch origin main
git fetch origin nightly:nightly
git checkout nightly
shell: bash

- name: "Attempt to merge main into nightly"
run: |
set +e
Expand All @@ -36,7 +35,7 @@ runs:
git config user.name "$(git log -n 1 --pretty=format:%an)"
git config user.email "$(git log -n 1 --pretty=format:%ae)"
if: ${{ inputs.do_push == 'true' && !env.ACT }}

- name: "Push to remote"
run: git push origin nightly
shell: bash
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/check_nightly.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: 🌃 Nightly Compatibility Check

on:
pull_request:
branches: [main]
Expand All @@ -12,6 +13,7 @@ jobs:
with:
# Fetches all history for all tags and branches
fetch-depth: 0

- run: |
git fetch origin
git reset --hard ${{ github.sha }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/nupm-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ env:
defaults:
run:
shell: nu {0}

jobs:
nupm-tests:
timeout-minutes: ${{ inputs.timeout }}
Expand All @@ -39,6 +40,7 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3

- name: Setup Nushell and Nupm (latest)
uses: ./.github/actions/setup_nupm
if: github.ref != 'refs/heads/nightly'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/sync_nightly.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: 🌃 Sync Main to Nightly

on:
pull_request:
types: [closed]
Expand All @@ -10,6 +11,7 @@ jobs:
if: github.event.pull_request.merged == true
steps:
- uses: actions/checkout@v3

- uses: ./.github/actions/sync_action
with:
do_push: true

0 comments on commit 01b971d

Please sign in to comment.