Build #207
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: Build | |
on: | |
workflow_dispatch: | |
push: | |
paths-ignore: | |
- '.github/**' | |
- 'doc/**' | |
tags-ignore: | |
- 'v*' | |
env: | |
NODE_VERSION: '18.14' | |
jobs: | |
lint: | |
if: ${{ false }} # disable for now | |
runs-on: ubuntu-latest | |
steps: | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- run: npm install | |
- name: Make npm binaries accessible | |
run: echo "${PWD}/node_modules/.bin" >> $GITHUB_PATH | |
- name: Lint code | |
run: qx lint | |
build: | |
runs-on: ubuntu-latest | |
# needs: lint | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build CometVisu | |
uses: ./.github/actions/build-cv | |
with: | |
target: build | |
unit-test: | |
name: "UNIT-TEST" | |
runs-on: ubuntu-latest | |
needs: build | |
strategy: | |
matrix: | |
target: ['stable', 'beta', 'unstable'] | |
browser: ['Chrome_ci'] | |
env: | |
CV_VERSION: ${{ matrix.target }} | |
CV_BROWSER: ${{ matrix.browser }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
- name: Build CometVisu | |
uses: ./.github/actions/build-cv | |
with: | |
target: source | |
- name: Install browser | |
run: ./utils/ci/browser-setup.sh | |
shell: bash | |
- name: Make browser binaries accessible | |
run: | | |
echo "${PWD}/chrome" >> $GITHUB_PATH | |
echo "${PWD}/firefox" >> $GITHUB_PATH | |
- name: Install grunt | |
run: npm install -g grunt-cli | |
- name: Run tests | |
run: grunt karma:ci --browser=$CV_BROWSER | |
env: | |
CHROME_BIN: ./chrome/google-chrome | |
- name: Run coveralls | |
if: env.CV_VERSION == 'stable' && env.CV_BROWSER == 'Chrome_ci' | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: "${{ secrets.GITHUB_TOKEN }}" | |
e2e-test: | |
name: "E2E-TEST" | |
runs-on: ubuntu-latest | |
needs: build | |
strategy: | |
matrix: | |
target: ['stable'] # beta is not running currently, 'beta'] | |
browser: ['Chrome_ci'] | |
env: | |
CV_VERSION: ${{ matrix.target }} | |
CV_BROWSER: ${{ matrix.browser }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
- name: Build CometVisu | |
uses: ./.github/actions/build-cv | |
with: | |
target: source | |
- name: Install browser | |
run: ./utils/ci/browser-setup.sh | |
shell: bash | |
- name: Make browser binaries accessible | |
run: | | |
echo "${PWD}/chrome" >> $GITHUB_PATH | |
echo "${PWD}/firefox" >> $GITHUB_PATH | |
- name: Prepare tests | |
uses: ./.github/actions/update-webdriver | |
- name: Run tests | |
run: grunt e2e-chrome | |
env: | |
CHROME_BIN: ./chrome/google-chrome | |
deploy-docker: | |
name: "[DEPLOY] - Deploy Docker container and Sentry release" | |
if: github.repository == 'CometVisu/CometVisu' && startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
needs: [ 'unit-test', 'e2e-test'] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
with: | |
buildkitd-flags: --debug | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
- run: npm install -g grunt-cli | |
- run: npm install | |
- name: Install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.0 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install python dependencies | |
run: | | |
python -m pip install -r utils/requirements.txt | |
- name: Update DocumentationMapping | |
run: ./cv doc --doc-type manual -f -l de | |
- name: Create CometVisu release for docker | |
run: CV_TAG_RUNTIME=docker grunt release-cv | |
- name: Move to release folder | |
run: mv release build | |
- name: Push to Docker Hub | |
run: ./utils/ci/docker_push.sh | |
env: | |
DOCKER_USER: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKER_PASS: ${{ secrets.DOCKERHUB_TOKEN }} | |
- run: | | |
curl -sL https://sentry.io/get-cli/ | bash | |
export SENTRY_RELEASE=$(sentry-cli releases propose-version) | |
sentry-cli releases new -p $SENTRY_PROJECT $SENTRY_RELEASE | |
sentry-cli releases set-commits --auto $SENTRY_RELEASE | |
sentry-cli releases files $SENTRY_RELEASE upload-sourcemaps build --no-rewrite --ignore node_modules/ --ignore test/ | |
sentry-cli releases finalize $SENTRY_RELEASE | |
env: | |
SENTRY_ORG: cometvisu | |
SENTRY_PROJECT: cometvisu | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} |