From db3c7713bb778f0a2305d5c30ff0bbc44d178c94 Mon Sep 17 00:00:00 2001 From: Ross MacArthur Date: Thu, 8 Oct 2020 22:59:30 +0200 Subject: [PATCH] Improve tests --- .github/workflows/build.yaml | 52 ++++++++++++++++++++++++++++++++++++ .github/workflows/main.yaml | 37 ------------------------- tests/Justfile | 2 ++ 3 files changed, 54 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/build.yaml delete mode 100644 .github/workflows/main.yaml create mode 100644 tests/Justfile diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..3e160f4 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,52 @@ +name: build + +on: push + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: '12.x' + - run: npm install --global @zeit/ncc + - run: npm ci + - run: npm run lint + - run: npm run build + + test-latest: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Setup just + uses: ./ + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Test + run: | + [ "$(just --justfile tests/Justfile)" = "Test..." ] + shell: bash + + test-version: + needs: test-latest + strategy: + matrix: + just-version: [0.4.5, 0.5.11, 0.6.1, 0.7.3, 0.8.0] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run self + uses: ./ + with: + just-version: ${{ matrix.just-version }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Check version + run: just --version | grep "^just v${{ matrix.just-version }}$" + - name: Test + run: | + [ "$(just --justfile tests/Justfile)" = "Test..." ] diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml deleted file mode 100644 index 3fbec59..0000000 --- a/.github/workflows/main.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: build - -on: push - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: '12.x' - - run: npm install --global @zeit/ncc - - run: npm ci - - run: npm run lint - - run: npm run build - - test: - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v2 - - - name: Run self - uses: ./ - with: - just-version: 0.4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Check just version - run: just --version | grep "^just v0.4.5$" - shell: bash diff --git a/tests/Justfile b/tests/Justfile new file mode 100644 index 0000000..47d5a1e --- /dev/null +++ b/tests/Justfile @@ -0,0 +1,2 @@ +test: + @echo "Test..."