-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
229 additions
and
61 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Setup nupm | ||
description: Install and setup nupm environment | ||
|
||
inputs: | ||
nu_version: | ||
required: true | ||
description: "A valid NPM-style semver specification, such as '0.86.0', etc. and 'nightly', supports '0.60.0' -> latest and latest 'nightly'" | ||
|
||
nupm_clone_path: | ||
required: true | ||
default: "/tmp/nupm" | ||
description: "The path where nupm will be cloned" | ||
|
||
nupm_path: | ||
required: true | ||
default: "~/.local/share/nupm" | ||
description: "The path where nupm will be installed" | ||
|
||
outputs: | ||
nupm_path: | ||
value: ${{ steps.set-output.outputs.nupm-path }} | ||
description: "The path to the installed nupm (can be `use`d directly) " | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: hustcer/setup-nu@v3.7 | ||
with: | ||
version: ${{ inputs.nu_version }} | ||
|
||
- name: Show Nushell Version | ||
run: version | ||
shell: nu {0} | ||
|
||
- run: | | ||
git clone --depth 1 https://github.com/nushell/nupm ${{ inputs.nupm_clone_path }} | ||
git -C ${{ inputs.nupm_clone_path }} checkout f7c0843f4d667194beae468614a46cc8d72cc5db | ||
shell: nu {0} | ||
- name: Install nupm | ||
shell: nu {0} | ||
id: set-output | ||
run: | | ||
use ${{ inputs.nupm_clone_path }}/nupm | ||
let nupm_home = "${{ inputs.nupm_path }}" | path expand | ||
with-env {NUPM_HOME: $nupm_home} { | ||
mkdir $env.NUPM_HOME | ||
nupm install --force --path "${{ inputs.nupm_clone_path }}" | ||
} | ||
'nupm-path="${{ inputs.nupm_path }}/modules/nupm"' | save --append $env.GITHUB_OUTPUT |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Sync Action | ||
description: Checks the mergeability of main into nightly and optionally pushes it. | ||
|
||
inputs: | ||
do_push: | ||
description: Whether to push changes after syncing | ||
required: true | ||
default: "false" | ||
log_worktree: | ||
description: Whether to log the worktree | ||
required: true | ||
default: "false" | ||
|
||
permissions: | ||
contents: write | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Checkout nightly | ||
run: | | ||
git fetch origin main | ||
git fetch origin nightly:nightly | ||
git checkout nightly | ||
shell: bash | ||
|
||
- name: Set up Git | ||
shell: bash | ||
run: | | ||
git config user.name "$(git log -n 1 --pretty=format:%an)" | ||
git config user.email "$(git log -n 1 --pretty=format:%ae)" | ||
- name: Show Git config and worktree | ||
shell: bash | ||
run: | | ||
git config --list | grep user.name | ||
git config --list | grep user.email | ||
git log --graph --branches --remotes --tags --oneline --decorate | ||
if: ${{ inputs.log_worktree == 'true' }} | ||
|
||
- name: "Attempt to merge main into nightly" | ||
run: | | ||
set +e | ||
git merge --no-ff origin/main -m "Merge main into nightly" | ||
MERGE_STATUS=$? | ||
set -e | ||
if [ $MERGE_STATUS -ne 0 ]; then | ||
echo "Merge conflict detected" | ||
exit 1 | ||
fi | ||
shell: bash | ||
|
||
- name: "Push to remote" | ||
run: git push origin nightly | ||
shell: bash | ||
if: ${{ inputs.do_push == 'true' && !env.ACT }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: 🌃 Nightly compatibility check | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
check-merge: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checking out repository | ||
uses: actions/checkout@v3 | ||
- name: Docker Fix (for act) | ||
run: | | ||
git fetch origin | ||
git reset --hard ${{ github.sha }} | ||
shell: bash | ||
if: ${{ env.ACT }} | ||
|
||
- uses: ./.github/actions/sync_action | ||
with: | ||
do_push: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,16 @@ | ||
name: 🧪 Tests | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- "**.md" | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
name: continuous-integration | ||
|
||
defaults: | ||
run: | ||
shell: nu {0} | ||
|
||
env: | ||
NU_LOG_LEVEL: DEBUG | ||
- nightly | ||
|
||
jobs: | ||
tests: | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
platform: [windows-latest, macos-latest, ubuntu-20.04] | ||
|
||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: hustcer/setup-nu@v3.6 | ||
with: | ||
version: '0.86' | ||
|
||
- name: Download the source of Nupm | ||
run: git clone --depth 1 https://github.com/nushell/nupm /tmp/nupm/ | ||
|
||
- name: Install Nupm | ||
run: | | ||
use /tmp/nupm/nupm | ||
with-env {NUPM_HOME: ("~/.local/share/nupm" | path expand)} { | ||
# FIXME: use --no-confirm option | ||
# related to https://github.com/nushell/nupm/pull/42 | ||
mkdir ("~/.local/share/nupm" | path expand) | ||
nupm install --force --path /tmp/nupm | ||
} | ||
- name: Show Nushell Version | ||
run: version | ||
|
||
- name: Run the tests | ||
run: | | ||
# FIXME: is there a way to not rely on hardcoded paths here? | ||
use ~/.local/share/nupm/modules/nupm | ||
nupm test --show-stdout | ||
uses: ./.github/workflows/nupm-tests.yml | ||
with: | ||
nu_version: "0.87.0" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# reusable workflow to be able to provide defaults to the CI | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
nu_version: | ||
description: "A valid NPM-style semver specification, such as '0.86.0', etc. and 'nightly', supports '0.60.0' -> latest and latest 'nightly'" | ||
default: "*" | ||
type: string | ||
timeout: | ||
description: "The timeout of the ci job. Default is 20min" | ||
default: 20 | ||
type: number | ||
|
||
workflow_call: | ||
inputs: | ||
nu_version: | ||
description: "A valid NPM-style semver specification, such as '0.86.0', etc. and 'nightly', supports '0.60.0' -> latest and latest 'nightly'" | ||
default: "*" | ||
type: string | ||
timeout: | ||
description: "The timeout of the ci job. Default is 20min" | ||
default: 20 | ||
type: number | ||
|
||
env: | ||
NU_LOG_LEVEL: DEBUG | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
||
defaults: | ||
run: | ||
shell: nu {0} | ||
|
||
jobs: | ||
nupm-tests: | ||
timeout-minutes: ${{ inputs.timeout }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
platform: [windows-latest, macos-latest, ubuntu-latest] | ||
|
||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup nushell and nupm | ||
uses: ./.github/actions/setup_nupm | ||
id: "nu-setup" | ||
with: | ||
nu_version: ${{github.ref == 'refs/heads/nightly' && 'nightly' || inputs.nu_version}} | ||
|
||
- name: Run the tests | ||
run: | | ||
use ${{ steps.nu-setup.outputs.nupm_path }} | ||
nupm test --show-stdout |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: 🌃 Sync main to nightly | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
branches: [main] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
sync_on_merge: | ||
runs-on: ubuntu-latest | ||
if: github.event.pull_request.merged == true | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
# Fetches all history for all tags and branches | ||
fetch-depth: 0 | ||
- uses: ./.github/actions/sync_action | ||
with: | ||
do_push: true | ||
log_worktree: true |
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
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
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
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
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
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