diff --git a/.github/workflows/compiles.yml b/.github/workflows/compiles.yml deleted file mode 100644 index 277b42849..000000000 --- a/.github/workflows/compiles.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Compiles - -on: - pull_request: - branches: - - master - push: - branches: - - master - -jobs: - build: - name: Compiles on Go ${{ matrix.go-version }} and ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - go-version: [1.17.x] - os: [ubuntu-latest] - steps: - - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Build on ${{ matrix.os }} - env: - GO111MODULE: on - GOOS: linux - run: | - make console diff --git a/.github/workflows/crosscompile-1.yml b/.github/workflows/crosscompile-1.yml deleted file mode 100644 index 5cf95aae0..000000000 --- a/.github/workflows/crosscompile-1.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Cross Compile 1 - -on: - pull_request: - branches: - - master - push: - branches: - - master - -jobs: - build: - name: Cross compile - runs-on: ${{ matrix.os }} - strategy: - matrix: - go-version: [1.17.x] - os: [ubuntu-latest] - steps: - - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Build on ${{ matrix.os }} - env: - GO111MODULE: on - GOOS: linux - run: | - make crosscompile arg1="'linux/ppc64le linux/mips64'" diff --git a/.github/workflows/crosscompile-2.yml b/.github/workflows/crosscompile-2.yml deleted file mode 100644 index c6bf201fb..000000000 --- a/.github/workflows/crosscompile-2.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Cross Compile 2 - -on: - pull_request: - branches: - - master - push: - branches: - - master - -jobs: - build: - name: Cross compile - runs-on: ${{ matrix.os }} - strategy: - matrix: - go-version: [1.17.x] - os: [ubuntu-latest] - steps: - - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Build on ${{ matrix.os }} - env: - GO111MODULE: on - GOOS: linux - run: | - make crosscompile arg1="'linux/arm64 linux/s390x'" diff --git a/.github/workflows/crosscompile-3.yml b/.github/workflows/crosscompile-3.yml deleted file mode 100644 index c7c2b717d..000000000 --- a/.github/workflows/crosscompile-3.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Cross Compile 3 - -on: - pull_request: - branches: - - master - push: - branches: - - master - -jobs: - build: - name: Cross compile - runs-on: ${{ matrix.os }} - strategy: - matrix: - go-version: [1.17.x] - os: [ubuntu-latest] - steps: - - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Build on ${{ matrix.os }} - env: - GO111MODULE: on - GOOS: linux - run: | - make crosscompile arg1="'darwin/amd64 freebsd/amd64'" diff --git a/.github/workflows/crosscompile-4.yml b/.github/workflows/crosscompile-4.yml deleted file mode 100644 index 9d2d24611..000000000 --- a/.github/workflows/crosscompile-4.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Cross Compile 4 - -on: - pull_request: - branches: - - master - push: - branches: - - master - -jobs: - build: - name: Cross compile - runs-on: ${{ matrix.os }} - strategy: - matrix: - go-version: [1.17.x] - os: [ubuntu-latest] - steps: - - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Build on ${{ matrix.os }} - env: - GO111MODULE: on - GOOS: linux - run: | - make crosscompile arg1="'windows/amd64 linux/arm'" diff --git a/.github/workflows/crosscompile-5.yml b/.github/workflows/crosscompile-5.yml deleted file mode 100644 index f201449d1..000000000 --- a/.github/workflows/crosscompile-5.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Cross Compile 5 - -on: - pull_request: - branches: - - master - push: - branches: - - master - -jobs: - build: - name: Cross compile - runs-on: ${{ matrix.os }} - strategy: - matrix: - go-version: [1.17.x] - os: [ubuntu-latest] - steps: - - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Build on ${{ matrix.os }} - env: - GO111MODULE: on - GOOS: linux - run: | - make crosscompile arg1="'linux/386 netbsd/amd64'" diff --git a/.github/workflows/go-test-pkg.yml b/.github/workflows/go-test-pkg.yml deleted file mode 100644 index b55f27a2b..000000000 --- a/.github/workflows/go-test-pkg.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Go Test Pkg - -on: - pull_request: - branches: - - master - push: - branches: - - master - -jobs: - build: - name: Test Pkg on Go ${{ matrix.go-version }} and ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - go-version: [1.17.x] - os: [ubuntu-latest] - steps: - - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Build on ${{ matrix.os }} - env: - GO111MODULE: on - GOOS: linux - run: | - make test-pkg diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index 6f13cbae5..000000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Go - -on: - pull_request: - branches: - - master - push: - branches: - - master - -jobs: - build: - name: Test Restapi on Go ${{ matrix.go-version }} and ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - go-version: [1.17.x] - os: [ubuntu-latest] - steps: - - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Build on ${{ matrix.os }} - env: - GO111MODULE: on - GOOS: linux - run: | - make test diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml deleted file mode 100644 index bfed50524..000000000 --- a/.github/workflows/integration.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Integration - -on: - pull_request: - branches: - - master - push: - branches: - - master - -# This ensures that previous jobs for the PR are canceled when the PR is -# updated. -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - -jobs: - minio-test: - name: Integration Tests with Latest Distributed MinIO - runs-on: ubuntu-latest - - strategy: - matrix: - go-version: [1.17.x] - - steps: - - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - # To build minio image, we need to clone the repository first - - name: clone https://github.com/minio/minio - uses: actions/checkout@master - with: - - # Repository name with owner. For example, actions/checkout - # Default: ${{ github.repository }} - repository: minio/minio - - # Relative path under $GITHUB_WORKSPACE to place the repository - # To have two repositories under the same test - path: 'minio_repository' - - - name: Build on ${{ matrix.os }} - run: | - echo "The idea is to build minio image from downloaded repository"; - cd $GITHUB_WORKSPACE/minio_repository; - echo "Get git version to build MinIO Image"; - VERSION=`git rev-parse HEAD`; - echo $VERSION; - echo "Create minio image"; - make docker VERSION=$VERSION; - echo "Jumping back to console repository to run the integration test" - cd $GITHUB_WORKSPACE; - echo "We are going to use the built image on test-integration"; - VERSION="minio/minio:$VERSION"; - echo $VERSION; - make test-integration MINIO_VERSION=$VERSION; diff --git a/.github/workflows/jobs.yaml b/.github/workflows/jobs.yaml new file mode 100644 index 000000000..5f1cf6b9b --- /dev/null +++ b/.github/workflows/jobs.yaml @@ -0,0 +1,521 @@ +name: Workflow + +on: + pull_request: + branches: + - master + push: + branches: + - master + +# This ensures that previous jobs for the PR are canceled when the PR is +# updated. +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +jobs: + lint-job: + name: Checking Lint + runs-on: ${{ matrix.os }} + strategy: + matrix: + go-version: [1.17.x] + os: [ubuntu-latest] + steps: + - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build on ${{ matrix.os }} + env: + GO111MODULE: on + GOOS: linux + run: | + make verifiers + + no-warnings-and-make-assets: + name: "React Code Has No Warnings and then Make Assets" + runs-on: ${{ matrix.os }} + strategy: + matrix: + go-version: [ 1.17.x ] + os: [ ubuntu-latest ] + steps: + - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + id: go + - uses: actions/setup-node@v2 + with: + node-version: '17' + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + - name: Check out operator as a nested repository + uses: actions/checkout@v2 + with: + repository: minio/operator + path: operator + - uses: actions/cache@v2 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + id: yarn-cache + with: + path: | + ${{ steps.yarn-cache-dir-path.outputs.dir }} + ./portal-ui/node_modules/ + ./portal-ui/build/ + key: ${{ runner.os }}-yarn-${{ hashFiles('./portal-ui/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install Dependencies + if: steps.yarn-cache.outputs.cache-hit != 'true' + working-directory: ./ + run: make assets + + - name: Check for Warnings in build output + working-directory: ./portal-ui + continue-on-error: false + run: | + chmod +x check-warnings.sh && ./check-warnings.sh + + compile-job: + name: Compiles on Go ${{ matrix.go-version }} and ${{ matrix.os }} + needs: + - lint-job + - no-warnings-and-make-assets + runs-on: ${{ matrix.os }} + strategy: + matrix: + go-version: [1.17.x] + os: [ubuntu-latest] + steps: + - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build on ${{ matrix.os }} + env: + GO111MODULE: on + GOOS: linux + run: | + make console + + cross-compile-1: + name: Cross compile + needs: + - lint-job + - no-warnings-and-make-assets + runs-on: ${{ matrix.os }} + strategy: + matrix: + go-version: [1.17.x] + os: [ubuntu-latest] + steps: + - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build on ${{ matrix.os }} + env: + GO111MODULE: on + GOOS: linux + run: | + make crosscompile arg1="'linux/ppc64le linux/mips64'" + + cross-compile-2: + name: Cross compile 2 + needs: + - lint-job + - no-warnings-and-make-assets + runs-on: ${{ matrix.os }} + strategy: + matrix: + go-version: [1.17.x] + os: [ubuntu-latest] + steps: + - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build on ${{ matrix.os }} + env: + GO111MODULE: on + GOOS: linux + run: | + make crosscompile arg1="'linux/arm64 linux/s390x'" + + cross-compile-3: + name: Cross compile 3 + needs: + - lint-job + - no-warnings-and-make-assets + runs-on: ${{ matrix.os }} + strategy: + matrix: + go-version: [1.17.x] + os: [ubuntu-latest] + steps: + - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build on ${{ matrix.os }} + env: + GO111MODULE: on + GOOS: linux + run: | + make crosscompile arg1="'darwin/amd64 freebsd/amd64'" + + cross-compile-4: + name: Cross compile 4 + needs: + - lint-job + - no-warnings-and-make-assets + runs-on: ${{ matrix.os }} + strategy: + matrix: + go-version: [1.17.x] + os: [ubuntu-latest] + steps: + - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build on ${{ matrix.os }} + env: + GO111MODULE: on + GOOS: linux + run: | + make crosscompile arg1="'windows/amd64 linux/arm'" + + cross-compile-5: + name: Cross compile 5 + needs: + - lint-job + - no-warnings-and-make-assets + runs-on: ${{ matrix.os }} + strategy: + matrix: + go-version: [1.17.x] + os: [ubuntu-latest] + steps: + - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build on ${{ matrix.os }} + env: + GO111MODULE: on + GOOS: linux + run: | + make crosscompile arg1="'linux/386 netbsd/amd64'" + + test-pkg-on-go: + name: Test Pkg on Go ${{ matrix.go-version }} and ${{ matrix.os }} + needs: + - lint-job + - no-warnings-and-make-assets + runs-on: ${{ matrix.os }} + strategy: + matrix: + go-version: [1.17.x] + os: [ubuntu-latest] + steps: + - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build on ${{ matrix.os }} + env: + GO111MODULE: on + GOOS: linux + run: | + make test-pkg + + test-restapi-on-go: + name: Test Restapi on Go ${{ matrix.go-version }} and ${{ matrix.os }} + needs: + - lint-job + - no-warnings-and-make-assets + runs-on: ${{ matrix.os }} + strategy: + matrix: + go-version: [1.17.x] + os: [ubuntu-latest] + steps: + - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build on ${{ matrix.os }} + env: + GO111MODULE: on + GOOS: linux + run: | + make test + + integration-tests: + name: Integration Tests with Latest Distributed MinIO + needs: + - lint-job + - no-warnings-and-make-assets + runs-on: ubuntu-latest + + strategy: + matrix: + go-version: [1.17.x] + + steps: + - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + # To build minio image, we need to clone the repository first + - name: clone https://github.com/minio/minio + uses: actions/checkout@master + with: + + # Repository name with owner. For example, actions/checkout + # Default: ${{ github.repository }} + repository: minio/minio + + # Relative path under $GITHUB_WORKSPACE to place the repository + # To have two repositories under the same test + path: 'minio_repository' + + - name: Build on ${{ matrix.os }} + run: | + echo "The idea is to build minio image from downloaded repository"; + cd $GITHUB_WORKSPACE/minio_repository; + echo "Get git version to build MinIO Image"; + VERSION=`git rev-parse HEAD`; + echo $VERSION; + echo "Create minio image"; + make docker VERSION=$VERSION; + echo "Jumping back to console repository to run the integration test" + cd $GITHUB_WORKSPACE; + echo "We are going to use the built image on test-integration"; + VERSION="minio/minio:$VERSION"; + echo $VERSION; + make test-integration MINIO_VERSION=$VERSION; + + react-tests: + name: React Tests + needs: + - lint-job + - no-warnings-and-make-assets + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install modules + working-directory: ./portal-ui + run: yarn + - name: Run tests + working-directory: ./portal-ui + run: yarn test + + operator-tests: + name: Operator Tests + needs: + - lint-job + - no-warnings-and-make-assets + runs-on: ${{ matrix.os }} + strategy: + matrix: + go-version: [ 1.17.x ] + os: [ ubuntu-latest ] + steps: + - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + id: go + - uses: actions/setup-node@v2 + with: + node-version: '17' + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + - name: Check out operator as a nested repository + uses: actions/checkout@v2 + with: + repository: minio/operator + path: operator + - uses: actions/cache@v2 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + id: yarn-cache + with: + path: | + ${{ steps.yarn-cache-dir-path.outputs.dir }} + ./portal-ui/node_modules/ + ./portal-ui/build/ + key: ${{ runner.os }}-yarn-${{ hashFiles('./portal-ui/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install Dependencies + if: steps.yarn-cache.outputs.cache-hit != 'true' + working-directory: ./ + run: make assets + + - name: Build Console on ${{ matrix.os }} + env: + GO111MODULE: on + GOOS: linux + run: | + make console + + # Runs a set of commands using the runners shell + - name: Start Kind for Operator UI + run: | + "${GITHUB_WORKSPACE}/portal-ui/tests/scripts/operator.sh" + + - name: Run TestCafe Tests + uses: DevExpress/testcafe-action@latest + with: + args: '"chrome:headless" portal-ui/tests/operator/ --skip-js-errors -c 3' + + permissions: + name: Permissions Tests + needs: + - lint-job + - no-warnings-and-make-assets + runs-on: ${{ matrix.os }} + strategy: + matrix: + go-version: [ 1.17.x ] + os: [ ubuntu-latest ] + steps: + - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + id: go + - uses: actions/setup-node@v2 + with: + node-version: '17' + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + id: yarn-cache + with: + path: | + ${{ steps.yarn-cache-dir-path.outputs.dir }} + ./portal-ui/node_modules/ + ./portal-ui/build/ + key: ${{ runner.os }}-yarn-${{ hashFiles('./portal-ui/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install Dependencies + if: steps.yarn-cache.outputs.cache-hit != 'true' + working-directory: ./ + run: make assets + + - name: Build Console on ${{ matrix.os }} + env: + GO111MODULE: on + GOOS: linux + run: | + make console + + - name: Start Console, front-end app and initialize users/policies + run: | + (./console server) & (make initialize-permissions) + + - name: Run TestCafe Tests + uses: DevExpress/testcafe-action@latest + with: + args: '"chrome:headless" portal-ui/tests/permissions/ --skip-js-errors -c 3' + + - name: Clean up users & policies + run: | + make cleanup-permissions diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 25fcda507..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Lint - -on: - pull_request: - branches: - - master - push: - branches: - - master - -jobs: - build: - name: Checking Lint - runs-on: ${{ matrix.os }} - strategy: - matrix: - go-version: [1.17.x] - os: [ubuntu-latest] - steps: - - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Build on ${{ matrix.os }} - env: - GO111MODULE: on - GOOS: linux - run: | - make verifiers diff --git a/.github/workflows/operator.yaml b/.github/workflows/operator.yaml deleted file mode 100644 index d7909b326..000000000 --- a/.github/workflows/operator.yaml +++ /dev/null @@ -1,72 +0,0 @@ -name: "Operator UI" - -on: - pull_request: - branches: - - master - push: - branches: - - master - -jobs: - permissions: - name: Operator Tests - runs-on: ${{ matrix.os }} - strategy: - matrix: - go-version: [ 1.17.x ] - os: [ ubuntu-latest ] - steps: - - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - id: go - - uses: actions/setup-node@v2 - with: - node-version: '17' - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - name: Check out operator as a nested repository - uses: actions/checkout@v2 - with: - repository: minio/operator - path: operator - - uses: actions/cache@v2 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v2 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Make assets - run: | - make assets - - name: Build Console on ${{ matrix.os }} - env: - GO111MODULE: on - GOOS: linux - run: | - make console - - # Runs a set of commands using the runners shell - - name: Start Kind for Operator UI - run: | - "${GITHUB_WORKSPACE}/portal-ui/tests/scripts/operator.sh" - - - name: Run TestCafe Tests - uses: DevExpress/testcafe-action@latest - with: - args: '"chrome:headless" portal-ui/tests/operator/ --skip-js-errors -c 3' diff --git a/.github/workflows/permissions.yml b/.github/workflows/permissions.yml deleted file mode 100644 index 3f14841e6..000000000 --- a/.github/workflows/permissions.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: "UI Permissions" - -on: - pull_request: - branches: - - master - push: - branches: - - master - -jobs: - permissions: - name: Permissions Tests - runs-on: ${{ matrix.os }} - strategy: - matrix: - go-version: [ 1.17.x ] - os: [ ubuntu-latest ] - steps: - - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - id: go - - uses: actions/setup-node@v2 - with: - node-version: '17' - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - uses: actions/cache@v2 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v2 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Make assets - run: | - make assets - - name: Build Console on ${{ matrix.os }} - env: - GO111MODULE: on - GOOS: linux - run: | - make console - - - name: Start Console, front-end app and initialize users/policies - run: | - (./console server) & (make initialize-permissions) - - - name: Run TestCafe Tests - uses: DevExpress/testcafe-action@latest - with: - args: '"chrome:headless" portal-ui/tests/permissions/ --skip-js-errors -c 3' - - - name: Clean up users & policies - run: | - make cleanup-permissions diff --git a/.github/workflows/react-no-warnings.yml b/.github/workflows/react-no-warnings.yml deleted file mode 100644 index 55c096563..000000000 --- a/.github/workflows/react-no-warnings.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: "React Code Has No Warnings" -on: - push: - pull_request: -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install modules - working-directory: ./portal-ui - run: yarn - - name: Check for Warnings in build output - working-directory: ./portal-ui - continue-on-error: false - run: | - chmod +x check-warnings.sh && ./check-warnings.sh diff --git a/.github/workflows/react.yml b/.github/workflows/react.yml deleted file mode 100644 index 5473fe136..000000000 --- a/.github/workflows/react.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: "React Tests" -on: - push: - pull_request: -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install modules - working-directory: ./portal-ui - run: yarn - - name: Run tests - working-directory: ./portal-ui - run: yarn test diff --git a/Makefile b/Makefile index 875562236..5182dfa6f 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ swagger-operator: @swagger generate server -A operator --main-package=operator --server-package=operatorapi --exclude-main -P models.Principal -f ./swagger-operator.yml -r NOTICE assets: - @(cd portal-ui; yarn install; make build-static; yarn prettier --write . --loglevel warn; cd ..) + @(cd portal-ui; yarn install --prefer-offline; make build-static; yarn prettier --write . --loglevel warn; cd ..) test-integration: @echo "create docker network to communicate containers MinIO & PostgreSQL"