Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
bbc1a76
feat(windows): try to use @actions/exec for setup on Windows
matbour Feb 1, 2021
a792832
ci(actions): use a timeout for tests
matbour Feb 1, 2021
ddbe9d7
ci(actions): run on v*-dev branches
matbour Feb 1, 2021
f7ee838
revert(windows): use execSync instead of @actions/exec
matbour Feb 1, 2021
82d4f30
chore(git): merge branch 'main' into v2.0.0-dev
matbour Oct 18, 2021
c3498a6
ci(actions): switch package manager to pnpm
matbour Oct 18, 2021
f06cca0
ci(actions): increase test timeout
matbour Oct 18, 2021
a142e62
ci(format): use @csquare/prettier-config configuration
matbour Oct 18, 2021
5c806a7
ci(actions): replace `husky` by `@arkweid/lefthook`
matbour Oct 18, 2021
38444e1
ci(format): add `.prettierrc`
matbour Oct 18, 2021
03b771c
build(bundle): replace `@zeit/ncc` by `esbuild`
matbour Oct 18, 2021
ecc58e7
feat(core): rewrite the action into tasks
matbour Oct 19, 2021
61ec495
fix(install): support local installation
matbour Oct 19, 2021
da300a5
fix(install): copy as fallback to the move operation
matbour Oct 19, 2021
820d6e5
fix(install): en environment variables to configure installer
matbour Oct 19, 2021
de6c4d7
fix(which): use teh `which` function of `@actions/io`
matbour Oct 20, 2021
9adc25a
fix(python): locate the python executable
matbour Oct 20, 2021
605fad4
ci(actions): add other versions
matbour Oct 20, 2021
47c6d1f
fix(install): debug installer with python
matbour Oct 20, 2021
c298973
feat(download): display the download URL
matbour Oct 20, 2021
56578b2
ci(actions): use the correct version numbers
matbour Oct 20, 2021
720d903
fix(install): attempt to use python 3
matbour Oct 20, 2021
d6f1334
fix(install): debug python NoneType slpit
matbour Oct 20, 2021
bcb9bfa
ci(actions): add new matrix configurations
matbour Oct 20, 2021
c3f3aed
fix(docker): use quiet mode to configure docker
matbour Oct 20, 2021
26e5f9a
fix(install): make installer `--quiet`
matbour Oct 20, 2021
4c7ed77
ci(actions): drop non-useful matrix configurations
matbour Oct 20, 2021
dfa9116
chore(repo): drop `tmp` directopry
matbour Oct 20, 2021
a2c2ccf
fix(install): attempt to use `spawn` on windows
matbour Oct 20, 2021
6992c7c
feat(install): do not install python on MacOS
matbour Oct 20, 2021
2a12845
ci(actions): use the local version on windows-2019
matbour Oct 20, 2021
b301bfd
fix(download): skip windows installation
matbour Oct 20, 2021
ef9e288
feat(groups): add logging groups
matbour Oct 20, 2021
802c14d
fix(gcloud): quote gcloud executable if necessary
matbour Oct 20, 2021
8887cab
ci(actions): add `ubuntu-18.04`, `macos-10.15`, `windows-2016`
matbour Oct 20, 2021
7322d97
ci(actions): drop macos-11 local installation
matbour Oct 20, 2021
188a0b4
feat(release): prepare for version 2.0
matbour Oct 20, 2021
e19b3cf
ci(tests): add more Jest tests
matbour Oct 20, 2021
60b00d2
ci(actions): attempt to debug Sonar Scan
matbour Oct 21, 2021
147215e
ci(sonar): use the master tag
matbour Oct 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
INPUT_VERSION=local
INPUT_PROJECT=auto
INPUT_COMPONENTS=beta
INPUT_SERVICE-ACCOUNT-KEY=***
INPUT_DESTINATION=~/google-cloud-sdk/{version}
RUNNER_TEMP=/home/mathieu/Documents/mathieu-bour/setup-gcloud/tmp
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
project: 'tsconfig.json',
sourceType: 'module',
},
ignorePatterns: ['.*.js'], // Ignore JS dotfiles, as they are configurations
ignorePatterns: ['*.js'], // Ignore JS dotfiles, as they are configurations
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
Expand Down
29 changes: 29 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Setup environment
description: Setup Node and install dependencies
inputs:
install:
description: Install the dependencies
default: 'false'
required: false
runs:
using: composite
steps:
- name: Get pnpm latest version
id: pnpm
run: echo "::set-output name=latest-version::$(npm show pnpm version)"
shell: bash
- name: Install dependencies with pnpm
uses: pnpm/action-setup@v2.0.1
with:
version: ${{ steps.pnpm.outputs.latest-version }}
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '12'
cache: pnpm
- name: Get pnpm latest version
shell: bash
run: |
if [ "${{ inputs.install }}" == 'true' ]; then
pnpm install
fi
66 changes: 49 additions & 17 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,50 +1,81 @@
name: Tests
on:
push:
branches: [ main ]
branches: [main]
pull_request:
types: [ opened, synchronize, reopened ]
types: [opened, synchronize, reopened]
jobs:
lint:
name: Lint with ESLint / Prettier
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
- name: Setup environment
uses: ./.github/actions/setup
with:
node-version: '12'
install: true
- name: Run ESLint
run: |
npm install
npm run lint
run: pnpm lint
unit_tests:
name: Test with Jest
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup environment
uses: ./.github/actions/setup
with:
install: true
- name: Run Jest
run: pnpm test -- --coverage
- name: Upload coverage reports
uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage/
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: [unit_tests]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Patch sonar.properties
run: sed -i s/\$VERSION/$(jq -r .version package.json)/ sonar-project.properties
- name: Download coverage reports
uses: actions/download-artifact@v2
with:
name: coverage
path: coverage/
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@v1.5
uses: SonarSource/sonarcloud-github-action@master
with:
args: >
-X
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
test:
integration_tests:
name: Integration tests
needs: [sonarcloud]
strategy:
matrix:
os: [ ubuntu-18.04, ubuntu-20.04, macos-10.15, windows-2019 ]
version: [ latest, local, 245.0.0 ]
project: [ auto, windys-lab ]
os:
- ubuntu-18.04
- ubuntu-20.04
- macos-10.15
- macos-11
- windows-2016
- windows-2019
version: [latest, local, 360.0.0]
project: [auto, windys-lab]
exclude:
- os: macos-10.15
version: local
- os: windows-2019
- os: macos-11
version: local
fail-fast: false
runs-on: ${{ matrix.os }}
Expand All @@ -56,8 +87,9 @@ jobs:
with:
version: ${{ matrix.version }}
project: ${{ matrix.project }}
components: beta
service-account-key: ${{ secrets.GCLOUD_AUTH }}
components: beta
configure-docker: europe-west6-docker.pkg.dev
- name: Test Google Cloud SDK CLI
run: |
gcloud version
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea/
node_modules/
/.idea
/node_modules
/coverage
3 changes: 0 additions & 3 deletions .huskyrc.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/coverage
/dist
/node_modules
/pnpm-lock.yaml
12 changes: 0 additions & 12 deletions .prettierrc.js

This file was deleted.

55 changes: 38 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,83 @@
# Changelog

## [Version 1.3.1](https://github.com/mathrix-education/setup-gcloud/releases/tag/1.3.1)
## [Version 2.0.0](https://github.com/mathieu-bour/setup-gcloud/releases/tag/2.0.0)

### Internal

- **build**(bundle): replace [`@zeit/ncc`](https://github.com/vercel/ncc) by [`esbuild`](https://esbuild.github.io/)
- **ci**(actions): switch package manager to pnpm
- **ci**(format): use [`@csquare/prettier-config`](https://www.npmjs.com/package/@csquare/prettier-config) configuration
- **ci**(hooks): replace `husky` by `@arkweid/lefthook`

## [Version 1.3.1](https://github.com/mathieu-bour/setup-gcloud/releases/tag/1.3.1)

- **ci**(actions): drop ubuntu-16.04 tests since it is deprecated
- **chore**(deps): upgrade dependencies (fixes CVE-2021-23337)

## [Version 1.3.0](https://github.com/mathrix-education/setup-gcloud/releases/tag/1.3.0)
## [Version 1.3.0](https://github.com/mathieu-bour/setup-gcloud/releases/tag/1.3.0)

- **feat**(docker): artifact registries may now be specified independently
- **ci**(sonarcloud): implement SonarCloud static analysis
- **chore**(rebrand): the repository is now maintained by [mathieu-bour](https://github.com/mathieu-bour)
- **chore**(deps): upgrade dependencies

## [Version 1.2.2](https://github.com/mathrix-education/setup-gcloud/releases/tag/1.2.2)
## [Version 1.2.2](https://github.com/mathieu-bour/setup-gcloud/releases/tag/1.2.2)

- **security**(deps): bump [@actions/core](https://github.com/actions/toolkit/tree/main/packages/core) from 1.2.4 to 1.2.6 (fixes [GHSA-mfwh-5m23-j46w](https://github.com/actions/toolkit/security/advisories/GHSA-mfwh-5m23-j46w))
- **fix**(ci): set setup-node version to @v1

## [Version 1.2.1](https://github.com/mathrix-education/setup-gcloud/releases/tag/1.2.1)
## [Version 1.2.1](https://github.com/mathieu-bour/setup-gcloud/releases/tag/1.2.1)

- **chore**(deps): bumps lodash from 4.17.15 to 4.17.19 (fixes GHSA-p6mc-m468-83gw)
- **chore**(repo): rename `master` branch to `main`

## [Version 1.2.0 - Local SDK](https://github.com/mathrix-education/setup-gcloud/releases/tag/1.2.0)
## [Version 1.2.0 - Local SDK](https://github.com/mathieu-bour/setup-gcloud/releases/tag/1.2.0)

- **feat**: add `local` for `version` input which will use the locally provided Google Cloud SDK if available
- **chore**(deps): upgrade dependencies
- **chore**: update license

## [Version 1.1.2](https://github.com/mathrix-education/setup-gcloud/releases/tag/1.1.2)
## [Version 1.1.2](https://github.com/mathieu-bour/setup-gcloud/releases/tag/1.1.2)

- **chore**(security): upgrade @actions/http-client dependency (GHSA-9w6v-m7wp-jwg4)

## [Version 1.1.1](https://github.com/mathrix-education/setup-gcloud/releases/tag/1.1.1)
## [Version 1.1.1](https://github.com/mathieu-bour/setup-gcloud/releases/tag/1.1.1)

- **ci**(lint): add eslint / prettier and action job
- **docs**(readme): break lines on new sentences
- **chore**(workspace): add standard commit, update pre-commit hook
- **chore**(security): upgrade minimist dependency (GHSA-7fhm-mqm4-2wp7)

## [Version 1.1.0](https://github.com/mathrix-education/setup-gcloud/releases/tag/1.1.0)
## [Version 1.1.0](https://github.com/mathieu-bour/setup-gcloud/releases/tag/1.1.0)

- **chore**(deps): bump TypeScript to version 3.8 (closes #9)
- **fix**: project configuration without service account key (closes #8)

## [Version 1.0.0 - Stable release](https://github.com/mathrix-education/setup-gcloud/releases/tag/1.0.0)
## [Version 1.0.0 - Stable release](https://github.com/mathieu-bour/setup-gcloud/releases/tag/1.0.0)

- **feat**: added support for Windows
- **fixed**: inputs are now compared to strings
- **fixed**: project guess using the `service-account-key` input
- **changed**: new install directories
- `/usr/lib/google-cloud-sdk` on Ubuntu runners (overrides the already installed one)
- `$HOME/opt/google-cloud-sdk` on MacOS runners
- `C:\Program Files\google-cloud-sdk` on Windows runners
- `/usr/lib/google-cloud-sdk` on Ubuntu runners (overrides the already installed one)
- `$HOME/opt/google-cloud-sdk` on MacOS runners
- `C:\Program Files\google-cloud-sdk` on Windows runners

## [Version 0.1.3 - Automatic project discovery](https://github.com/mathieu-bour/setup-gcloud/releases/tag/0.1.3)

## [Version 0.1.3 - Automatic project discovery](https://github.com/mathrix-education/setup-gcloud/releases/tag/0.1.3)
- **feat**: make `project` input optional - it is discovered with the service account key
- **feat**: compile using ES6 library
- **docs**: add examples in the README.md, better input descriptions
- **chore**: add license and other legal stuff

## [Version 0.1.2](https://github.com/mathrix-education/setup-gcloud/releases/tag/0.1.2)
## [Version 0.1.2](https://github.com/mathieu-bour/setup-gcloud/releases/tag/0.1.2)

- **feat**: add `project` input support
- **feat**: make service-account-key input optional - authentication is executed later
- **chore**: rename repository from mathrix-education/actions-gcloud to mathrix-education/setup-gcloud
- **chore**: rename repository from mathrix-education/actions-gcloud to mathieu-bour/setup-gcloud

## [Version 0.1.1](https://github.com/mathieu-bour/setup-gcloud/releases/tag/0.1.1)

## [Version 0.1.1](https://github.com/mathrix-education/setup-gcloud/releases/tag/0.1.1)
- **fixed**: set `version` input default value to 'latest' in `action.yml.

## [Version 0.1.0 - First release](https://github.com/mathrix-education/setup-gcloud/releases/tag/0.1.0)
## [Version 0.1.0 - First release](https://github.com/mathieu-bour/setup-gcloud/releases/tag/0.1.0)
Loading