From 878be005117abb02235b6a600d31f43fa9bde61e Mon Sep 17 00:00:00 2001 From: Hugo Josefson Date: Mon, 1 Apr 2024 15:39:45 +0200 Subject: [PATCH] Revert "chore: delete github action" This reverts commit e4aa3d2fbfd3dbabe5a9d5ab02bbb457d7a7ca5e. --- .github/workflows/ci.yml | 121 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4473b0b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,121 @@ +name: ci + +on: + push: + branches: "main" + + pull_request: + branches: "*" + +jobs: + meta: + runs-on: ubuntu-22.04 + outputs: + deno-version: ${{ steps.meta.outputs.deno-version }} + steps: + - uses: actions/checkout@v4 + - id: meta + run: | + echo "deno-version=$(cat .deno-version)" >> "${GITHUB_OUTPUT}" + + make: + runs-on: "${{ matrix.os }}-latest" + needs: meta + name: "${{ matrix.os }}: make ${{ matrix.target }} w/ deno ${{ matrix.deno-version }}" + + strategy: + fail-fast: false + matrix: + os: + - "ubuntu-20.04" + - "ubuntu-22.04" + - "macos-14" + - "macos-14-arm64" + target: + - "clean all" + - "test" + - "docker-test" + - "docker-output-test" + deno-version: + - "1.0.0" + - "${{ needs.meta.outputs.deno-version }}" + - "^1" + exclude: + - target: "docker-output-test" + deno-version: "1.0.0" + - os: "macos-14" + target: "clean all" + - os: "macos-14" + target: "docker-test" + - os: "macos-14" + target: "docker-output-test" + - os: "macos-14-arm64" + target: "clean all" + - os: "macos-14-arm64" + target: "docker-test" + - os: "macos-14-arm64" + target: "docker-output-test" + steps: + - uses: actions/checkout@v4 + + - name: setup deno ${{ matrix.deno-version }} + uses: denoland/setup-deno@v1 + with: + deno-version: ${{ matrix.deno-version }} + + - name: make ${{ matrix.target }} + run: make ${{ matrix.target }} + + make-from-scratch: + runs-on: "${{ matrix.os }}" + name: "${{ matrix.os }}: make ${{ matrix.target }} w/o deno" + + strategy: + fail-fast: false + matrix: + os: + - "ubuntu-20.04" + - "ubuntu-22.04" + - "macos-14" + - "macos-14-arm64" + target: + - "clean all" + - "test" + - "docker-test" + exclude: + - os: "macos-14" + target: "clean all" + - os: "macos-14" + target: "docker-test" + - os: "macos-14-arm64" + target: "clean all" + - os: "macos-14-arm64" + target: "docker-test" + + steps: + - uses: actions/checkout@v4 + + - name: delete any deno binaries on PATH + run: | + set -e + + delete_next_deno() { + deno_path="$(command -v deno)" + if [ -z "$deno_path" ]; then + return 1 + fi + if ! [ -x "$deno_path" ]; then + return 1 + fi + echo "deleting $deno_path" + rm -f "$deno_path" + } + + while delete_next_deno; do + : + done + + ! deno --version + + - name: make ${{ matrix.target }} + run: make ${{ matrix.target }}