|
| 1 | +name: Varnish Tests |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + |
| 6 | +jobs: |
| 7 | + leia-tests: |
| 8 | + runs-on: ${{ matrix.os }} |
| 9 | + env: |
| 10 | + TERM: xterm |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + leia-tests: |
| 14 | + - examples/4.x |
| 15 | + - examples/6.x |
| 16 | + - examples/custom |
| 17 | + lando-versions: |
| 18 | + - edge |
| 19 | + os: |
| 20 | + - ubuntu-20.04 |
| 21 | + node-version: |
| 22 | + - '14' |
| 23 | + steps: |
| 24 | + # Install deps and cache |
| 25 | + # Eventually it would be great if these steps could live in a separate YAML file |
| 26 | + # that could be included in line to avoid code duplication |
| 27 | + - name: Checkout code |
| 28 | + uses: actions/checkout@v2 |
| 29 | + - name: Install node ${{ matrix.node-version }} |
| 30 | + uses: actions/setup-node@v2 |
| 31 | + with: |
| 32 | + node-version: ${{ matrix.node-version }} |
| 33 | + - name: Get Yarn cache directory |
| 34 | + id: yarn-cache-dir-path |
| 35 | + run: echo "::set-output name=dir::$(yarn cache dir)" |
| 36 | + - name: Use Yarn cache |
| 37 | + uses: actions/cache@v2 |
| 38 | + id: yarn-cache |
| 39 | + with: |
| 40 | + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} |
| 41 | + key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }} |
| 42 | + - name: Install Yarn dependencies |
| 43 | + run: yarn install --prefer-offline --frozen-lockfile |
| 44 | + |
| 45 | + # This block should eventually become use lando/actions-hyperdrive@v2 |
| 46 | + - name: Verify Docker dependencies |
| 47 | + run: | |
| 48 | + docker --version | grep "20.10." |
| 49 | + docker-compose --version | grep "1.29." |
| 50 | + - name: Grab latest edge Lando CLI |
| 51 | + run: | |
| 52 | + sudo curl -fsSL -o /usr/local/bin/lando "https://files.lando.dev/cli/lando-linux-x64-${{ matrix.lando-versions }}" |
| 53 | + sudo chmod +x /usr/local/bin/lando |
| 54 | + - name: Move in lando config appropriate for testing |
| 55 | + run: | |
| 56 | + mkdir -p ~/.lando/cache |
| 57 | + cp -f actions-lando-config.yml ~/.lando/config.yml |
| 58 | + echo false > ~/.lando/cache/report_errors |
| 59 | + lando --clear |
| 60 | + - name: Verify Lando works and we are dogfooding this plugin for tests |
| 61 | + run: | |
| 62 | + lando version |
| 63 | + lando config --path plugins | grep varnish | grep /home/runner/work/varnish/varnish || echo "::error:: Not dogfooding this plugin correctly! " |
| 64 | +
|
| 65 | + # This block should eventually become use lando/actions-leia@v2 |
| 66 | + # @NOTE? Do we want a way for our leia-action to configure apparmor since |
| 67 | + # this might break a whole bunch of tests? or is this literally just a thing |
| 68 | + # for the Lagoon mysql/mariadb container? |
| 69 | + - name: Configure apparmor |
| 70 | + run: | |
| 71 | + set -x |
| 72 | + sudo apt-get remove mysql-server --purge |
| 73 | + sudo apt-get install apparmor-profiles |
| 74 | + sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld |
| 75 | + - name: Run leia tests |
| 76 | + shell: bash |
| 77 | + run: yarn leia "./${{ matrix.leia-tests }}/README.md" -c 'Destroy tests' --stdin --shell bash |
0 commit comments