|
| 1 | +name: Basic Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "user/**" |
| 7 | + - "feature/**" |
| 8 | + - "improvement/**" |
| 9 | + - "bugfix/**" |
| 10 | + - "documentation/**" |
| 11 | + - "release/**" |
| 12 | + |
| 13 | + |
| 14 | +jobs: |
| 15 | + tests: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - name: Checkout |
| 19 | + uses: actions/checkout@v2 |
| 20 | + - uses: actions/setup-go@v2 |
| 21 | + with: |
| 22 | + go-version: '^1.13.1' |
| 23 | + - uses: actions/setup-python@v2 |
| 24 | + with: |
| 25 | + python-version: '3.6' |
| 26 | + - name: install configs |
| 27 | + env: |
| 28 | + OPERATOR_SDK_VERSION: v0.17.0 |
| 29 | + run: | |
| 30 | + sudo apt-get update -y |
| 31 | + sudo apt-get install -y gcc hardlink make ca-certificates genisoimage |
| 32 | + python3.6 -m pip install pyyaml --user |
| 33 | +
|
| 34 | + . /etc/os-release |
| 35 | + echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list |
| 36 | + curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | sudo apt-key add - |
| 37 | + sudo apt-get update |
| 38 | + sudo apt-get -y upgrade |
| 39 | + sudo apt-get -y install skopeo |
| 40 | +
|
| 41 | + sudo curl -RLo /bin/operator-sdk https://github.com/operator-framework/operator-sdk/releases/download/${OPERATOR_SDK_VERSION}/operator-sdk-${OPERATOR_SDK_VERSION}-x86_64-linux-gnu \ |
| 42 | + && sudo chmod +x /bin/operator-sdk |
| 43 | + - name: Set Example Solution version property |
| 44 | + id: production-version |
| 45 | + run: | |
| 46 | + export PRODUCTION_VERSION_EXAMPLE=$(bash -c '. VERSION && echo "$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH$VERSION_SUFFIX"') |
| 47 | + echo "::set-output name=PRODUCTION_VERSION_EXAMPLE::${PRODUCTION_VERSION_EXAMPLE}" |
| 48 | + - name: Build Solution Example ISO |
| 49 | + run: make iso |
| 50 | + - name: copy files to artifacts |
| 51 | + run: | |
| 52 | + mkdir -p artifacts |
| 53 | + cp -r _build/example-solution-${{ steps.production-version.outputs.PRODUCTION_VERSION_EXAMPLE }}.iso _build/SHA256SUM artifacts |
| 54 | + - run: mkdir build_status && echo -n "SUCCESSFUL" > "build_status/.final_status" |
| 55 | + - uses: scality/action-artifacts@v1 |
| 56 | + with: |
| 57 | + url: https://artifacts.scality.net |
| 58 | + user: ${{ secrets.ARTIFACTS_USER }} |
| 59 | + password: ${{ secrets.ARTIFACTS_PASSWORD }} |
| 60 | + source: artifacts, build_status |
| 61 | + method: upload |
| 62 | + |
| 63 | + if-failed: |
| 64 | + runs-on: ubuntu-latest |
| 65 | + needs: [ tests ] |
| 66 | + if: always() && needs.tests.result == 'failure' |
| 67 | + steps: |
| 68 | + - run: mkdir build_status && echo -n "FAILED" > "build_status/.final_status" |
| 69 | + - uses: scality/action-artifacts@v1 |
| 70 | + with: |
| 71 | + url: https://artifacts.scality.net |
| 72 | + user: ${{ secrets.ARTIFACTS_USER }} |
| 73 | + password: ${{ secrets.ARTIFACTS_PASSWORD }} |
| 74 | + source: build_status |
| 75 | + method: upload |
0 commit comments