Skip to content

Commit e5837bc

Browse files
committed
Merge branch 'main' into thyeggman/logs-unicode-chars
2 parents 6e202ff + 4585bf9 commit e5837bc

File tree

93 files changed

+1826
-1666
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+1826
-1666
lines changed

.devcontainer/.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@github:registry=https://npm.pkg.github.com
2+

.devcontainer/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
### Development in Codespaces
2+
3+
This Codespaces/devcontainer setup uses [npm workspaces](https://docs.npmjs.com/cli/v8/using-npm/workspaces) to allow us to test changes to multiple packages.
4+
5+
npm workspaces are really meant for mono-repos, but we can use that feature here to link our various packages together so you can make changes to a package and immediately consume those changes in a dependent package.
6+
7+
### Make changes
8+
9+
1. Open the workspace in VS Code `File -> Open Workspace from File...`: `/workspaces/vscode-github-actions.code-workspace`
10+
1. Make change to any of the packages
11+
1. Build them all with `npm run build -ws` in `/workspaces/`
12+
1. Start and debug extension
13+
14+
#### Updating dependencies
15+
16+
17+
Once you're happy with your changes, publish the changes to the respective packages. You might have to adjust package versions, so if you made a change to `actions-workflow-parser` and increase the version there, you will have to consume the updated package in `actions-languageservice`.
18+
19+
`npm workspaces` hoists all dependencies into a shared `node_modules` folder at the root directory (`/workspaces/node_modules`) and also creates a single `package-lock.json` file there for the whole workspace. We don't want that when pushing changes back to the individual repos.
20+
21+
There is a script in `/workspaces`: `update-package-locks.sh` that does an `npm install` in every package directory _without_ using workspaces. That way, the local `package-lock.json` file is generated correctly and can be pushed to the repository.
22+
23+
### Debugging
24+
25+
Launching and debugging the extension should just work. If you need to debug the language server, start the extension first, then execute the `Attach to language-server` target to also attach to the language server.

.devcontainer/devcontainer.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"onCreateCommand": ".devcontainer/on-create-command.sh",
3+
"features": {
4+
"ghcr.io/devcontainers/features/node:1": {
5+
"version": "latest"
6+
}
7+
},
8+
"extensions": ["ms-vscode-remote.remote-containers"],
9+
"hostRequirements": {
10+
"cpus": 32,
11+
"memory": "8gb"
12+
},
13+
"customizations": {
14+
"codespaces": {
15+
"repositories": {
16+
"github/actions-expressions": {
17+
"permissions": {
18+
"contents": "write, read",
19+
"packages": "read",
20+
"pull_requests": "write",
21+
"workflows": "write"
22+
}
23+
},
24+
"github/actions-workflow-parser": {
25+
"permissions": {
26+
"contents": "write, read",
27+
"packages": "read",
28+
"pull_requests": "write",
29+
"workflows": "write"
30+
}
31+
},
32+
"github/actions-languageservice": {
33+
"permissions": {
34+
"contents": "write, read",
35+
"packages": "read",
36+
"pull_requests": "write",
37+
"workflows": "write"
38+
}
39+
},
40+
"github/actions-languageserver": {
41+
"permissions": {
42+
"contents": "write, read",
43+
"packages": "read",
44+
"pull_requests": "write",
45+
"workflows": "write"
46+
}
47+
}
48+
}
49+
}
50+
}
51+
}

.devcontainer/on-create-command.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
set -e
3+
4+
function clone_repo() {
5+
GREEN='\033[0;32m'
6+
7+
REPOSITORY_URL=$1
8+
REPOSITORY_PATH=$2
9+
if [[ ! -d "$REPOSITORY_PATH/.git" ]]; then
10+
echo -e "\n${GREEN}➡️ Cloning $REPOSITORY_URL...\n${NC}"
11+
git clone "$REPOSITORY_URL" "$REPOSITORY_PATH"
12+
fi
13+
}
14+
15+
# Cache git credentials
16+
git config --global credential.helper cache
17+
git credential-cache exit
18+
19+
# Clone dependent repos
20+
clone_repo https://github.com/github/actions-expressions /workspaces/actions-expressions
21+
clone_repo https://github.com/github/actions-workflow-parser /workspaces/actions-workflow-parser
22+
clone_repo https://github.com/github/actions-languageservice /workspaces/actions-languageservice
23+
clone_repo https://github.com/github/actions-languageserver /workspaces/actions-languageserver
24+
25+
# Copy workspace files
26+
cp /workspaces/vscode-github-actions/.devcontainer/package.json /workspaces/
27+
cp /workspaces/vscode-github-actions/.devcontainer/vscode-github-actions.code-workspace /workspaces/
28+
cp /workspaces/vscode-github-actions/.devcontainer/.npmrc /workspaces/
29+
cp /workspaces/vscode-github-actions/.devcontainer/update-package-locks.sh /workspaces/
30+
31+
# Setup npm auth
32+
echo "//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}" > ~/.npmrc
33+
34+
# Setup npm workspace
35+
pushd /workspaces
36+
npm i
37+
# Build all packages locally
38+
npm run build -ws

.devcontainer/package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"private": true,
3+
"workspaces": [
4+
"./actions-expressions/typescript",
5+
"./actions-workflow-parser/typescript",
6+
"./actions-languageservice",
7+
"./actions-languageserver",
8+
"./vscode-github-actions"
9+
]
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
set -e
3+
4+
for DIR in "actions-expressions/typescript" "actions-workflow-parser/typescript" "actions-languageservice" "actions-languageserver" "vscode-github-actions"
5+
do
6+
pushd $DIR
7+
# Trigger an npm i without workspaces support to update the local package-lock.json
8+
npm i --workspaces=false
9+
popd
10+
done
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"folders": [
3+
{ "path": "./actions-expressions/typescript", "name": "actions-expressions/typescript" },
4+
{ "path": "./actions-workflow-parser/typescript", "name": "actions-workflow-parser/typescript" },
5+
{ "path": "./actions-languageservice"},
6+
{ "path": "./actions-languageserver"},
7+
{ "path": "./vscode-github-actions"}
8+
]
9+
}

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @github/c2c-actions-experience-parser-reviewers

.github/workflows/build-preview.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/checkout@v2
1212
- uses: actions/setup-node@v2-beta
1313
with:
14-
node-version: '12'
14+
node-version: "12"
1515
- run: rm package-lock.json
1616
- run: npm --no-git-tag-version version 1.0.${{ github.run_number }}
1717
- run: npm install
@@ -22,7 +22,7 @@ jobs:
2222
env:
2323
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2424
with:
25-
tag_name: 'build-${{ github.run_number }}'
25+
tag_name: "build-${{ github.run_number }}"
2626
release_name: Nightly Build ${{ github.run_number }}
2727
draft: false
2828
prerelease: false

.github/workflows/build.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
13-
- uses: actions/setup-node@v1
13+
- uses: actions/setup-node@v3
1414
with:
15-
node-version: 12.x
16-
- name: npm install, build
17-
run: |
18-
npm ci
19-
npm run build --if-present
15+
node-version: 16.x
16+
cache: "npm"
17+
registry-url: "https://npm.pkg.github.com"
18+
- run: npm ci
19+
env:
20+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
- name: build
22+
run: npm run build --if-present
2023
env:
2124
CI: true

0 commit comments

Comments
 (0)