[temporary] test adding a RELEASE file #282
Workflow file for this run
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
name: CI/CD | ||
on: | ||
push: | ||
branches: [ master ] | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
branches: [ master ] | ||
jobs: | ||
cache-job: | ||
runs-on: ${{ matrix.os }} | ||
outputs: | ||
id: yarn-cache | ||
name: build-output | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node-version: [16] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
- name: Cache node_modules with yarn | ||
uses: actions/cache@v2 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install Dependencies | ||
run: yarn --frozen-lockfile --ignore-scripts | ||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
needs: cache-job | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node-version: [16] | ||
steps: | ||
- name: install dependencies on ubuntu | ||
if: startsWith(matrix.os,'ubuntu') | ||
run: | | ||
sudo apt install -y make gcc pkg-config build-essential libx11-dev libxkbfile-dev | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: build | ||
run: yarn --frozen-lockfile | ||
ui-test: | ||
timeout-minutes: 60 | ||
runs-on: ${{ matrix.os }} | ||
needs: cache-job | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node-version: [16] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
- name: Install dependencies and build | ||
run: yarn | ||
- name: Package VSCode Extension | ||
run: yarn vsce:package | ||
- name: Download sample traces | ||
run: yarn download:sample-traces | ||
- name: Download trace server | ||
run: yarn download:server | ||
- name: Start trace server | ||
run: yarn start:server & | ||
- name: Download openvscode-server | ||
run: yarn download:openvscode-server | ||
- name: Configure openvscode-server | ||
run: yarn configure:openvscode-server | ||
- name: Start openvscode-server | ||
run: yarn start:openvscode-server & | ||
- name: Install Playwright Browsers | ||
run: yarn playwright install --with-deps | ||
- name: Run Playwright tests | ||
run: yarn playwright test | ||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 | ||
- name: 'Tar extension' | ||
run: tar -czvf extension.tar.gz vscode-trace-extension/*.vsix | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: extension | ||
path: extension.tar.gz | ||
code-lint: | ||
runs-on: ${{ matrix.os }} | ||
needs: cache-job | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node-version: [16] | ||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
# ESLint and Prettier must be in `package.json` | ||
- name: Install dependencies | ||
run: yarn --frozen-lockfile --ignore-scripts | ||
- name: Run lint | ||
run: yarn lint | ||
- name: Run format check | ||
run: yarn format:check | ||
publish: | ||
runs-on: ${{ matrix.os }} | ||
needs: | ||
- cache-job | ||
- build | ||
- ui-test | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node-version: [16] | ||
name: Publish to openvsx.org | ||
if: startsWith(github.ref, 'refs/tags/') | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: extension | ||
path: extension.tar.gz | ||
- name: 'untar extension' | ||
run: tar -xzvf extension.tar.gz | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Publish | ||
run: | | ||
# Not final version - for now use this step to check if things we expect seem to be in place | ||
ls -alR | grep .vsix | ||
if [[ -n "OVSX_PAT" ]]; then | ||
echo "OVSX_PAT is defined" | ||
else | ||
echo "OVSX_PAT is not defined." | ||
fi | ||
#npx ovsx publish -i artifacts/*/*.vsix # --debug | ||
env: | ||
OVSX_PAT: ${{ secrets.OPEN_VSX_TOKEN }} # have ovsx consume the PAT from environment |