Integrating some refactorings from Save parameter page #461
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: Continuous Integration / Continuous Delivery Workflow for the Parameter Page web application | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
Integration-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
test: | |
- smoke_test | |
- display_parameter_page_test | |
- delete_entry_from_page_test | |
- add_comment_to_page_test | |
- reorganize_parameters_test | |
- cancel_page_edits_test | |
- add_parameter_to_page_test | |
- clear_all_entries_test | |
- create_new_parameter_page_test | |
- change_display_units_test | |
- display_parameter_alarms_test | |
- display_digital_status_detail_test | |
- recall_parameter_page_test | |
- write_to_parameter_test | |
- save_parameter_page_test | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Cache Flutter dependencies | |
uses: actions/cache@v3 | |
with: | |
path: /opt/hostedtoolcache/flutter | |
key: flutter-install-cache | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
cache: true | |
- name: Install Chrome beta | |
id: setup-chrome | |
uses: browser-actions/setup-chrome@v1 | |
with: | |
chrome-version: beta | |
- name: Installing chromedriver (needed for Integration tests) | |
uses: nanasess/setup-chromedriver@v2 | |
with: | |
chromedriver-version: "116.0.5845.49" | |
- name: Starting chromedriver and executing integration test | |
run: | | |
chromedriver --port=4444 & | |
flutter drive --chrome-binary=${{ steps.setup-chrome.outputs.chrome-path }} --driver=test_driver/integration_test.dart --target=test/integration_tests/${{ matrix.test }}.dart -d web-server --dart-define=USE_MOCK_SERVICES=true | |
Linter-UnitTest-SmokeTest: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out source code | |
uses: actions/checkout@v3 | |
- name: Cache Flutter dependencies | |
uses: actions/cache@v3 | |
with: | |
path: /opt/hostedtoolcache/flutter | |
key: flutter-install-cache | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
cache: true | |
- name: Resolving dependencies | |
run: flutter pub get | |
- name: Linting | |
run: flutter analyze . | |
- name: Running unit tests | |
run: | | |
flutter test test/unit_tests | |
- name: Running widget tests | |
run: | | |
flutter test test/widget_tests | |
Build-Dockerize-Push: | |
runs-on: ubuntu-latest | |
needs: [ Linter-UnitTest-SmokeTest, Integration-tests] | |
steps: | |
- name: Checking out source code | |
uses: actions/checkout@v3 | |
- name: Cache Flutter dependencies | |
uses: actions/cache@v3 | |
with: | |
path: /opt/hostedtoolcache/flutter | |
key: flutter-install-cache | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
cache: true | |
- name: Resolving dependencies | |
run: flutter pub get | |
- name: Building web application | |
run: | | |
flutter build web | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: adregistry.fnal.gov/applications/parameter-page | |
tags: | | |
# This is the default tag for the last commit of the default branch | |
type=edge | |
# This is used on a push event and requires a valid semver Git tag | |
type=semver,pattern={{version}} | |
# This tags PRs with the PR number. E.g., refs/pull/2/merge -> pr-2 | |
type=ref,event=pr | |
# This sets the latest tag for default branch | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=raw,value=${{ github.run_number }},enable={{is_default_branch}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to AD Registry, Harbor | |
uses: docker/login-action@v2 | |
with: | |
registry: adregistry.fnal.gov | |
username: ${{ secrets.ADREGISTRY_USERNAME }} | |
password: ${{ secrets.ADREGISTRY_SECRET }} | |
- name: Building Docker image and pushing to adregistry | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |