some fixes #10674
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 | |
on: | |
push: {} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- name: Install bazelisk | |
run: | | |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.1.0/bazelisk-linux-amd64" | |
mkdir -p "${GITHUB_WORKSPACE}/bin/" | |
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel" | |
chmod +x "${GITHUB_WORKSPACE}/bin/bazel" | |
- name: Enable CI settings | |
run: | | |
cat <<EOF >>.bazelrc | |
common --config=ci | |
EOF | |
- name: Add bazel cache secret | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
run: | | |
echo "$GCS_SA_KEY" > key.json | |
cat <<EOF >>.bazelrc | |
build:ci --remote_cache=https://storage.googleapis.com/airy-ci-cache | |
build:ci --google_credentials=key.json | |
EOF | |
env: | |
GCS_SA_KEY: ${{secrets.GCS_SA_KEY}} | |
- name: Install dependencies | |
run: yarn install | |
- name: Run unit testing | |
run: yarn jest --coverage | |
- name: Lint | |
run: | | |
sudo apt-get install -y shellcheck | |
./scripts/lint.sh | |
- name: Test | |
run: | | |
bazel test --test_tag_filters=-lint //... | |
- name: Build all artifacts | |
run: | | |
bazel build //... | |
- name: Push images | |
if: startsWith(github.ref, 'refs/heads/release') || startsWith(github.ref, 'refs/heads/main') || startsWith(github.ref, 'refs/heads/develop') | |
run: | | |
echo ${{ secrets.PAT }} | docker login ghcr.io -u airydevci --password-stdin | |
./scripts/push-images.sh | |
- name: Upload airy binary to S3 | |
if: ${{ github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/release') || github.ref == 'refs/heads/main' }} | |
run: | | |
./scripts/upload-cli-binaries.sh | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
GITHUB_BRANCH: ${{ github.ref }} | |
- name: Publish helm charts | |
if: startsWith(github.ref, 'refs/heads/release') || startsWith(github.ref, 'refs/heads/main') || startsWith(github.ref, 'refs/heads/develop') | |
run: | | |
./scripts/push-helm-charts.sh | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION : ${{ secrets.AWS_REGION }} | |
GITHUB_BRANCH: ${{ github.ref }} | |
HELM_REPO_USERNAME: ${{ secrets.HELM_REPO_USERNAME }} | |
HELM_REPO_PASSWORD: ${{ secrets.HELM_REPO_PASSWORD }} | |
- name: Publish http-client library to npm | |
if: ${{ startsWith(github.ref, 'refs/heads/main') }} | |
run: | | |
sudo apt-get install -y expect | |
bazel run //lib/typescript/httpclient:publish-npm release | |
env: | |
DEPLOY_NPM_USERNAME: ${{ secrets.DEPLOY_NPM_USERNAME }} | |
DEPLOY_NPM_TOKEN: ${{ secrets.DEPLOY_NPM_TOKEN }} | |
DEPLOY_NPM_EMAIL: ${{ secrets.DEPLOY_NPM_EMAIL }} | |
- name: Publish chat-plugin library to npm | |
if: ${{ startsWith(github.ref, 'refs/heads/main') }} | |
run: | | |
sudo apt-get install -y expect | |
bazel run //frontend/chat-plugin/lib:publish-npm release | |
env: | |
DEPLOY_NPM_USERNAME: ${{ secrets.DEPLOY_NPM_USERNAME }} | |
DEPLOY_NPM_TOKEN: ${{ secrets.DEPLOY_NPM_TOKEN }} | |
DEPLOY_NPM_EMAIL: ${{ secrets.DEPLOY_NPM_EMAIL }} |