Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into save-options
Browse files Browse the repository at this point in the history
  • Loading branch information
priyamsahoo authored Feb 15, 2024
2 parents 4870cea + 8447a0a commit 71036ef
Show file tree
Hide file tree
Showing 19 changed files with 2,152 additions and 1,934 deletions.
5 changes: 4 additions & 1 deletion .config/Containerfile → .config/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM quay.io/ansible/creator-ee:v0.18.0 as DEFAULT_EE
FROM quay.io/ansible/creator-ee:v24.2.0 as DEFAULT_EE
# This file is updated by dependabot and used to determine not only which
# version of creator-ee we are supposed to use for testing execution
# environments but also to dynamically retrieve the same set of constraints
# for testing outside execution environments.
#
# Do not rename this file to Containerfile due to
# https://github.com/dependabot/dependabot-core/issues/6067
6 changes: 4 additions & 2 deletions .config/dictionary.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Ansible
CFLAGS
Containerfile
Dpkg
FQCN
Expand Down Expand Up @@ -37,6 +38,7 @@ deps
devel
direnv
dirhtml
dirmngr
docker
doctree
doctrees
Expand All @@ -58,8 +60,10 @@ lineinfile
linkcheck
linkify
loglevel
lssh
lxml
markdownlint
mkdocs
monospace
mycollection
mymodule
Expand All @@ -73,7 +77,6 @@ notfound
npmjs
npmrc
nvim
nvmrc
parseable
patchback
pgrep
Expand Down Expand Up @@ -118,7 +121,6 @@ wordwrap
workdir
xvfb
yammlint
mkdocs

# names and usernames:
Ganesh
Expand Down
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# This VIRTUAL_ENV value is also configured inside .vscode/settings.json:
export HOSTNAME="${HOSTNAME:-localhost}"
export VIRTUAL_ENV="out/venvs/${HOSTNAME}"
export VIRTUAL_ENV="${PWD}/out/venvs/${HOSTNAME}"

# Activate virtualenv (creates it if needed)
layout python
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ack.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# See https://github.com/ansible-community/devtools/blob/main/.github/workflows/ack.yml
# See https://github.com/ansible/team-devtools/blob/main/.github/workflows/ack.yml
name: ack
on:
pull_request_target:
types: [opened, labeled, unlabeled, synchronize]

jobs:
ack:
uses: ansible-community/devtools/.github/workflows/ack.yml@main
uses: ansible/team-devtools/.github/workflows/ack.yml@main
2 changes: 1 addition & 1 deletion .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
node-version: 16.x
registry-url: 'https://registry.npmjs.org'
- name: Install Task
uses: arduino/setup-task@v1
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# See https://github.com/ansible-community/devtools/blob/main/.github/workflows/push.yml
# See https://github.com/ansible/team-devtools/blob/main/.github/workflows/push.yml
name: push
on:
push:
Expand All @@ -9,4 +9,4 @@ on:

jobs:
ack:
uses: ansible-community/devtools/.github/workflows/push.yml@main
uses: ansible/team-devtools/.github/workflows/push.yml@main
90 changes: 39 additions & 51 deletions .github/workflows/task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ env:
FORCE_COLOR: "1" # make mocha output colorful
# https://docs.github.com/en/actions/learn-github-actions/environment-variables
# https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows/
WSLENV: CI:FORCE_COLOR:GITHUB_ACTION:GITHUB_ACTION_PATH/p:GITHUB_ACTION_REPOSITORY:GITHUB_WORKFLOW:GITHUB_WORKSPACE/p:GITHUB_PATH/p
WSLENV: HOSTNAME:CI:FORCE_COLOR:GITHUB_ACTION:GITHUB_ACTION_PATH/p:GITHUB_ACTION_REPOSITORY:GITHUB_WORKFLOW:GITHUB_WORKSPACE/p:GITHUB_PATH/p
# We define a hostname because otherwise the variable might not always be accessible on runners.
HOSTNAME: gha

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -38,12 +40,10 @@ jobs:
matrix:
os:
- ubuntu-22.04
node-version:
- "16"
task-name:
- vscode
- test-node14
- test-node16
- test
- test-node-lts
upload-artifact:
- false
name:
Expand All @@ -60,31 +60,35 @@ jobs:
os: windows-2022
shell: "wsl-bash {0}"
- name: test-without-ee (macos)
os: macos-11
os: macos-12
# runner does not support running container
task-name: test-without-ee
skip_docker: "1"
skip_podman: "1"

steps:
- name: Disable autocrlf
if: "contains(matrix.os, 'windows')"
if: contains(matrix.os, 'windows')
run: |-
git config --global core.autocrlf false
git config --global core.eol lf
shell: bash # <-- keep it here to avoid using default shell

- uses: actions/checkout@v4

- name: Setup asdf
if: "!contains(matrix.shell, 'wsl')"
uses: asdf-vm/actions/install@v3

# https://github.com/marketplace/actions/setup-wsl
- name: Activate WSL
if: "contains(matrix.shell, 'wsl')"
uses: Vampire/[email protected].1
uses: Vampire/[email protected].2
with:
set-as-default: 'true'
# we want to load user profile
# https://github.com/Vampire/setup-wsl#wsl-shell-command
wsl-shell-command: "bash -euo pipefail"
wsl-shell-command: "bash -l -euo pipefail"
# https://github.com/MicrosoftDocs/WSL/blob/main/WSL/wsl-config.md#L159
wsl-conf: |
[automount]
Expand All @@ -98,78 +102,62 @@ jobs:
hostname = wsl
additional-packages:
curl
dirmngr
gawk
git
gpg
make
python3-dev
python3-pip
python3-venv
qemu-user-static
xvfb
# asdf nodejs plugin requires: dirmngr gpg curl gawk

- name: Set up Python ${{ matrix.python_version || '3.10' }}
if: "!contains(matrix.shell, 'wsl')"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version || '3.10' }}

- name: Enable caching
if: "!contains(matrix.shell, 'wsl')"
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cache/npm
~/.cache/pip
~/.cache/yarn
~/.nvm/.cache
~/Library/Caches/pip
key: >
${{ runner.os }}-${{ matrix.task-name }}-${{ hashFiles(
'package.json',
'package-lock.json',
'.config/Containerfile'
'.config/Dockerfile'
) }}
- name: Enable caching for podman-machine
uses: actions/cache@v3
uses: actions/cache@v4
if: "contains(matrix.os, 'macos')"
with:
path: |
~/.local/share/containers
~/.config/containers
key: ${{ runner.os }}-${{ matrix.task-name }}-${{ hashFiles('package.json', 'yarn.lock', '.config/Containerfile', '**/Taskfile.yml', 'tools/*.*') }}

- name: Install Task
if: "!contains(matrix.shell, 'wsl')"
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Task (wsl)
if: "contains(matrix.shell, 'wsl')"
run: |
sudo apt-get update && sudo apt-get install -y curl
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
task --version
- name: Dump node version into .nvmrc file
# save node version in .nvmrc file by looking for a pattern like
# node12 in job name. If pattern is not found it uses 'current' alias
if: "!contains(matrix.shell, 'wsl')"
run: >
python3 -c 'import os, re;
v = re.search("node(\d+)", os.environ.get("JOB_NAME", "")) or ["", "current"];
print(v[1])' > .nvmrc
- name: Use node
# as Windows executables are exposed inside WSL at top of PATH, we
# would end with broken npm script in PATH on wsl.
if: "!contains(matrix.shell, 'wsl')"
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
key: ${{ runner.os }}-${{ matrix.task-name }}-${{ hashFiles('package.json', 'yarn.lock', '.config/Dockerfile', '**/Taskfile.yml', 'tools/*.*') }}

- name: Install task inside WSL
- name: Install asdf inside WSL
if: "contains(matrix.shell, 'wsl')"
run: |
mkdir -p ~/.local/bin
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
echo $PATH
command -v task
set -ex
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0
echo '. "$HOME/.asdf/asdf.sh"' >> ~/.bashrc
export ASDF_DIR="$HOME/.asdf"
. "$HOME/.asdf/asdf.sh"
asdf plugin add nodejs
asdf plugin add python
asdf plugin add task
asdf install
asdf info
- run: task setup

Expand All @@ -190,7 +178,7 @@ jobs:
- name: Upload test logs
if: ${{ always() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: logs-${{ matrix.os }}-${{ matrix.task-name }}.zip
path: |
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ UNKNOWN.egg-info
change-notes-*.md

# Ignored because we support multiple versions and switch between them
.nvmrc
.node-version
.task
.venv
Expand Down
14 changes: 9 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ repos:
- id: shellcheck
args:
- --color=always
- -e
- SC1091
- repo: local
hooks:
- id: npm-ci
Expand Down Expand Up @@ -52,12 +54,12 @@ repos:
files: "codecov.yml"
pass_filenames: false
- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v7.3.1
rev: v8.3.0
hooks:
- id: cspell
name: Spell check with cspell
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v4.4.0
rev: v4.5.0
hooks:
- id: end-of-file-fixer
exclude: >
Expand Down Expand Up @@ -88,11 +90,13 @@ repos:
language_version: python3
- repo: https://github.com/pre-commit/mirrors-prettier
# keep it before markdownlint and eslint
rev: "v3.0.3"
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
additional_dependencies:
- prettier
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.37.0
rev: v0.39.0
hooks:
- id: markdownlint
exclude: >
Expand All @@ -101,7 +105,7 @@ repos:
docs/settings.md
$
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.50.0
rev: v9.0.0-alpha.2
hooks:
- id: eslint
args:
Expand Down
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nodejs 18.19.0 20.11.0
task 3.33.1
Loading

0 comments on commit 71036ef

Please sign in to comment.