Skip to content

Commit

Permalink
Test uname on WSL
Browse files Browse the repository at this point in the history
  • Loading branch information
carlocab committed Nov 11, 2024
1 parent 4d71346 commit cbb14f8
Showing 1 changed file with 20 additions and 44 deletions.
64 changes: 20 additions & 44 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,25 @@ on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- name: Upload metadata
uses: actions/upload-artifact@v4
with:
name: event_payload
path: ${{ github.event_path }}

- name: Dump metadata
run: |
printf '### Contents of `%s`\n' "${GITHUB_EVENT_PATH}" >>"${GITHUB_STEP_SUMMARY}"
printf '```\n' >>"${GITHUB_STEP_SUMMARY}"
jq . "${GITHUB_EVENT_PATH}" | tee -a "${GITHUB_STEP_SUMMARY}"
printf '```\n' >>"${GITHUB_STEP_SUMMARY}"
- name: Show contents of `github.event` object
run: |
printf '### Contents of `github.event`\n' >>"${GITHUB_STEP_SUMMARY}"
printf '```\n' >>"${GITHUB_STEP_SUMMARY}"
jq . <<<"${GITHUB_EVENT_DATA}" | tee -a "${GITHUB_STEP_SUMMARY}"
printf '```\n' >>"${GITHUB_STEP_SUMMARY}"
jq . <<<"${GITHUB_EVENT_DATA}" >github_event.json
env:
GITHUB_EVENT_DATA: ${{ toJSON(github.event) }}

- name: Upload `github.event` data
uses: actions/upload-artifact@v4
with:
name: github_event_payload
path: github_event.json

- name: Check if `github_event.json` and `event.json` are different
run: |
MESSAGE_PREFIX="::notice ::${GITHUB_EVENT_PATH} and github_event.json are"
if diff "${GITHUB_EVENT_PATH}" github_event.json; then
printf '%s different\n' "${MESSAGE_PREFIX}"
else
printf '%s identical\n' "${MESSAGE_PREFIX}"
fi
- name: Show `GITHUB_*` environment variables
- name: Set up WSL
shell: powershell
run: |
printf '### `GITHUB_*` environment variables\n' >>"${GITHUB_STEP_SUMMARY}"
printf '```\n' >>"${GITHUB_STEP_SUMMARY}"
env | grep -E '^GITHUB_' | sort | tee -a "${GITHUB_STEP_SUMMARY}"
printf '```\n' >>"${GITHUB_STEP_SUMMARY}"
wsl --update
wsl --version
wsl --set-default-version 2
# `wsl --install Ubuntu-22.04 --no-launch` has been having issues in CI since 2024-06-14
Invoke-WebRequest https://github.com/microsoft/WSL/raw/master/distributions/DistributionInfo.json |
Select-Object -ExpandProperty Content |
ConvertFrom-JSON |
Select-Object -ExpandProperty Distributions |
Where-Object Name -EQ "Ubuntu-22.04" |
Select-Object -ExpandProperty Amd64PackageUrl |
% { Invoke-WebRequest $_ -OutFile Ubuntu2204.appx }
Add-AppxPackage Ubuntu2204.appx
ubuntu2204 install --root
wsl --set-default Ubuntu-22.04
wsl --list --verbose
wsl --exec uname -a
wsl --exec uname -v

0 comments on commit cbb14f8

Please sign in to comment.