Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tchia04/cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: launchableinc/cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.
Loading
Showing 320 changed files with 32,597 additions and 4,455 deletions.
4 changes: 4 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build --java_language_version=8
build --java_runtime_version=remotejdk_11
build --tool_java_language_version=11
build --tool_java_runtime_version=remotejdk_11
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.5.0
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -6,3 +6,6 @@ root = true
insert_final_newline = true
charset=utf-8
indent_style=space

[*.java]
indent_size = 4
15 changes: 0 additions & 15 deletions .gitbook.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changelog:
exclude:
labels:
- tagpr
34 changes: 34 additions & 0 deletions .github/workflows/bazel-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Bazel test
on:
push:
branches:
- main
paths:
- 'WORKSPACE'
- 'src/**'
- '!src/**.md'
pull_request:
paths:
- 'WORKSPACE'
- 'src/**'
- '!src/**.md'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up JDK 8
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
with:
distribution: temurin
java-version: '8'
- name: Setup Bazel
uses: bazelbuild/setup-bazelisk@b39c379c82683a5f25d34f0d062761f62693e0b2 # v3.0.0
- name: Cache Bazel outputs
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: "~/.cache/bazel"
key: bazel
- name: Run Bazel test
run: |
bazel test //...
122 changes: 122 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: e2e

on:
push:
branches: [main]
workflow_dispatch:


env:
LAUNCHABLE_DEBUG: 1
LAUNCHABLE_REPORT_ERROR: 1
# The WORKSPACE file is disabled by default in Bazel 8.
# As a workaround, we configure the old version.
USE_BAZEL_VERSION: "7.x"


jobs:
tests:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: launchableinc/examples
path: examples
- name: Set up JDK 1.8
uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'temurin'
- uses: actions/setup-go@v5
with:
go-version: 1.22
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
# bazel
- name: Install Bazelisk
run: |
go install github.com/bazelbuild/bazelisk@latest
- name: "bazel: verify"
run: "launchable verify"
env:
LAUNCHABLE_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN_BAZEL }}
- name: "bazel: Record build"
run: 'launchable record build --name "$GITHUB_RUN_ID" --source main=../.. --source cli=../../..'
env:
LAUNCHABLE_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN_BAZEL }}
working-directory: examples/bazel/java
- name: "bazel: Subset"
run: bazelisk query 'tests(//...)' | launchable subset --target 30% bazel > subset.txt
env:
LAUNCHABLE_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN_BAZEL }}
working-directory: examples/bazel/java
- name: "bazel: Run test"
run: bazelisk test $(cat subset.txt)
working-directory: examples/bazel/java
- name: "bazel: Record test results"
run: launchable record tests bazel .
if: always()
env:
LAUNCHABLE_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN_BAZEL }}
working-directory: examples/bazel/java
# go
- name: Install go-junit-report
run: |
go install github.com/jstemmer/go-junit-report@latest
working-directory: examples/go
- name: "go: verify"
run: "launchable verify"
env:
LAUNCHABLE_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN_GO }}
- name: "go: Record build"
run: 'launchable record build --name "$GITHUB_RUN_ID" --source main=.. --source cli=../..'
env:
LAUNCHABLE_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN_GO }}
working-directory: examples/go
- name: "go: Subset"
run: go test -list="Test|Example" ./... | launchable subset --confidence 80% go-test > launchable-subset.txt
env:
LAUNCHABLE_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN_GO }}
working-directory: examples/go
- name: "go: Run test"
run: go test -run $(cat launchable-subset.txt) ./... -v 2>&1 | go-junit-report -set-exit-code > report.xml
working-directory: examples/go
- name: "go: Record test results"
run: launchable record tests go-test report.xml
if: always()
env:
LAUNCHABLE_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN_GO }}
working-directory: examples/go
# gradle
- name: "gradle: verify"
run: "launchable verify"
env:
LAUNCHABLE_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN_GRADLE }}
- name: "gradle: Record build"
run: 'launchable record build --name "$GITHUB_RUN_ID" --source main=.. --source cli=../..'
env:
LAUNCHABLE_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN_GRADLE }}
working-directory: examples/gradle
- name: "gradle: Subset"
run: launchable subset --target 80% gradle src/test/java > launchable-subset.txt
env:
LAUNCHABLE_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN_GRADLE }}
working-directory: examples/gradle
- name: "gradle: Run test"
run: ./gradlew test $(cat launchable-subset.txt)
working-directory: examples/gradle
- name: "gradle: Record test results"
run: launchable record tests gradle build/test-results/test
if: always()
env:
LAUNCHABLE_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN_GRADLE }}
working-directory: examples/gradle
94 changes: 82 additions & 12 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -4,33 +4,78 @@
name: Python package

on:
workflow_dispatch:
push:
branches: [ main ]
paths-ignore:
- 'WORKSPACE'
- 'src/**'
pull_request:
branches: [ main ]
paths-ignore:
- 'WORKSPACE'
- 'src/**'
schedule:
# This job runs at 00:00 JST every day.
- cron: '0 9 * * *'

env:
LAUNCHABLE_ORGANIZATION: "launchableinc"
LAUNCHABLE_WORKSPACE: "cli"
GITHUB_PULL_REQUEST_URL: ${{ github.event.pull_request.html_url }}
GITHUB_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}

permissions:
id-token: write
contents: read

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
os: [ubuntu-20.04, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up JDK 1.8
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
with:
java-version: 8
distribution: 'temurin'
- name: Install specific dependencies in 3.6
if: matrix.python-version == '3.6'
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
with:
max_attempts: 3
timeout_minutes: 5
retry_on: error
command: |
python -m pip install --upgrade pip
pip install pipenv==2021.11.5
pipenv install --dev --python ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
pipenv install --dev
if: matrix.python-version != '3.6'
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
with:
max_attempts: 3
timeout_minutes: 5
retry_on: error
command: |
python -m pip install --upgrade pip
pip install pipenv
pipenv install --dev --python ${{ matrix.python-version }}
- name: Build
run: |
pipenv run pip list
pipenv run build
pipenv run install
- name: Type check
@@ -39,8 +84,33 @@ jobs:
run: |
# stop the build if there are Python syntax errors or undefined names
pipenv run lint
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
pipenv run lint-warn
- name: Test with unittest
- name: Pull request validation
run: |
pipenv run test
# Install Launchable CLI from this repos's code
pip3 install . > /dev/null
set -x
launchable verify
# Tell Launchable about the build you are producing and testing
launchable record build --name ${GITHUB_RUN_ID}
launchable record session --build ${GITHUB_RUN_ID} --flavor os=${{ matrix.os }} --flavor python=${{ matrix.python-version }} > session.txt
# Find 25% of the relevant tests to run for this change
find tests -name test_*.py | grep -v tests/data | launchable subset --target 25% --session $(cat session.txt) --rest launchable-remainder.txt file > subset.txt
function record() {
# Record test results
LAUNCHABLE_SLACK_NOTIFICATION=true launchable record tests --session $(cat session.txt) file test-results/*.xml
}
trap record EXIT
# Test subset of tests
pipenv run test-xml $(tr '\r\n' '\n' < subset.txt)
# Test rest of tests
pipenv run test-xml $(tr '\r\n' '\n' < launchable-remainder.txt)
shell: bash
Loading