From b983b25405265d86f61653bfbebea8a28cb61f4a Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Tue, 23 Apr 2024 07:57:32 -0700 Subject: [PATCH] wip: thin CI so it runs faster --- .github/workflows/build.yaml | 75 +------------------------- .github/workflows/checks.yaml | 4 -- .github/workflows/flakehub-cache.yml | 32 ----------- .github/workflows/release-branches.yml | 67 ----------------------- .github/workflows/release-prs.yml | 21 -------- .github/workflows/release-tags.yml | 71 ------------------------ 6 files changed, 1 insertion(+), 269 deletions(-) delete mode 100644 .github/workflows/flakehub-cache.yml delete mode 100644 .github/workflows/release-branches.yml delete mode 100644 .github/workflows/release-tags.yml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 653bc07..2aa8276 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -5,56 +5,8 @@ on: workflow_call: jobs: - build-artifacts-ARM64-macOS: - runs-on: macos-latest-xlarge - permissions: - contents: read - id-token: write - steps: - - uses: actions/checkout@v3 - - - uses: DeterminateSystems/nix-installer-action@main - - - uses: DeterminateSystems/magic-nix-cache-action@main - - - name: Build package - run: "nix build .# -L --fallback && nix-store --export $(nix-store -qR ./result) | xz -9 > magic-nix-cache.closure.xz" - - - name: Upload a Build Artifact - uses: actions/upload-artifact@v3.1.2 - with: - # Artifact name - name: magic-nix-cache-ARM64-macOS - path: magic-nix-cache.closure.xz - retention-days: 1 - - build-artifacts-X64-macOS: - runs-on: macos-12 - permissions: - contents: read - id-token: write - steps: - - uses: actions/checkout@v3 - - - uses: DeterminateSystems/flake-checker-action@main - - - uses: DeterminateSystems/nix-installer-action@main - - - uses: DeterminateSystems/magic-nix-cache-action@main - - - name: Build package - run: "nix build .# -L --fallback && nix-store --export $(nix-store -qR ./result) | xz -9 > magic-nix-cache.closure.xz" - - - name: Upload a Build Artifact - uses: actions/upload-artifact@v3.1.2 - with: - # Artifact name - name: magic-nix-cache-X64-macOS - path: magic-nix-cache.closure.xz - retention-days: 1 - build-artifacts-X64-Linux: - runs-on: ubuntu-22.04 + runs-on: UbuntuLatest32Cores128G permissions: contents: read id-token: write @@ -77,28 +29,3 @@ jobs: name: magic-nix-cache-X64-Linux path: magic-nix-cache.closure.xz retention-days: 1 - - build-artifacts-ARM64-Linux: - runs-on: namespace-profile-default-arm64 - permissions: - contents: read - id-token: write - steps: - - uses: actions/checkout@v3 - - - uses: DeterminateSystems/flake-checker-action@main - - - uses: DeterminateSystems/nix-installer-action@main - - - uses: DeterminateSystems/magic-nix-cache-action@main - - - name: Build package - run: "nix build .# -L --fallback && nix-store --export $(nix-store -qR ./result) | xz -9 > magic-nix-cache.closure.xz" - - - name: Upload a Build Artifact - uses: actions/upload-artifact@v3.1.2 - with: - # Artifact name - name: magic-nix-cache-ARM64-Linux - path: magic-nix-cache.closure.xz - retention-days: 1 diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index a2295da..89acd01 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -28,7 +28,3 @@ jobs: - name: Clippy run: nix develop --command cargo clippy - - build: - uses: ./.github/workflows/build.yaml - secrets: inherit diff --git a/.github/workflows/flakehub-cache.yml b/.github/workflows/flakehub-cache.yml deleted file mode 100644 index c7969de..0000000 --- a/.github/workflows/flakehub-cache.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Push dev shell to FlakeHub Cache - -on: - push: - branches: [main] - -jobs: - push-dev-shell-to-flakehub-cache: - env: - ACTIONS_STEP_DEBUG: true - runs-on: ${{ matrix.systems.runner }} - permissions: - id-token: "write" - contents: "read" - strategy: - matrix: - systems: - - nix-system: "aarch64-darwin" - runner: "macos-latest-xlarge" - - nix-system: "x86_64-darwin" - runner: "macos-12" - - nix-system: "x86_64-linux" - runner: "ubuntu-22.04" - steps: - - uses: actions/checkout@v3 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - with: - use-flakehub: true - - name: Build dev shell for ${{ matrix.systems.nix-system }} on ${{ matrix.systems.runner }} - run: | - nix build .#devShells.${{ matrix.systems.nix-system }}.default diff --git a/.github/workflows/release-branches.yml b/.github/workflows/release-branches.yml deleted file mode 100644 index 86e1b71..0000000 --- a/.github/workflows/release-branches.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Release Branch - -on: - push: - branches: - # NOTE: make sure any branches here are also valid directory names, - # otherwise creating the directory and uploading to s3 will fail - - "main" - -jobs: - build: - uses: ./.github/workflows/build.yaml - secrets: inherit - - release: - needs: build - - concurrency: release - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write # In order to request a JWT for AWS auth - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ secrets.AWS_S3_UPLOAD_ROLE }} - aws-region: us-east-2 - - - name: Create the artifacts directory - run: rm -rf ./artifacts && mkdir ./artifacts - - - uses: actions/download-artifact@v3 - with: - name: magic-nix-cache-ARM64-macOS - path: cache-binary-ARM64-macOS - - name: Persist the cache binary - run: cp ./cache-binary-ARM64-macOS/magic-nix-cache.closure.xz ./artifacts/magic-nix-cache-ARM64-macOS - - - uses: actions/download-artifact@v3 - with: - name: magic-nix-cache-X64-macOS - path: cache-binary-X64-macOS - - name: Persist the cache binary - run: cp ./cache-binary-X64-macOS/magic-nix-cache.closure.xz ./artifacts/magic-nix-cache-X64-macOS - - - uses: actions/download-artifact@v3 - with: - name: magic-nix-cache-X64-Linux - path: cache-binary-X64-Linux - - name: Persist the cache binary - run: cp ./cache-binary-X64-Linux/magic-nix-cache.closure.xz ./artifacts/magic-nix-cache-X64-Linux - - - uses: actions/download-artifact@v3 - with: - name: magic-nix-cache-ARM64-Linux - path: cache-binary-ARM64-Linux - - name: Persist the cache binary - run: cp ./cache-binary-ARM64-Linux/magic-nix-cache.closure.xz ./artifacts/magic-nix-cache-ARM64-Linux - - - name: Publish Release (Branch) - env: - AWS_BUCKET: ${{ secrets.AWS_S3_UPLOAD_BUCKET }} - run: | - .github/workflows/upload_s3.sh branch "${{ github.ref_name }}" "$GITHUB_SHA" diff --git a/.github/workflows/release-prs.yml b/.github/workflows/release-prs.yml index 9d6a26e..ae40941 100644 --- a/.github/workflows/release-prs.yml +++ b/.github/workflows/release-prs.yml @@ -36,20 +36,6 @@ jobs: - name: Create the artifacts directory run: rm -rf ./artifacts && mkdir ./artifacts - - uses: actions/download-artifact@v3 - with: - name: magic-nix-cache-ARM64-macOS - path: cache-binary-ARM64-macOS - - name: Persist the cache binary - run: cp ./cache-binary-ARM64-macOS/magic-nix-cache.closure.xz ./artifacts/magic-nix-cache-ARM64-macOS - - - uses: actions/download-artifact@v3 - with: - name: magic-nix-cache-X64-macOS - path: cache-binary-X64-macOS - - name: Persist the cache binary - run: cp ./cache-binary-X64-macOS/magic-nix-cache.closure.xz ./artifacts/magic-nix-cache-X64-macOS - - uses: actions/download-artifact@v3 with: name: magic-nix-cache-X64-Linux @@ -57,13 +43,6 @@ jobs: - name: Persist the cache binary run: cp ./cache-binary-X64-Linux/magic-nix-cache.closure.xz ./artifacts/magic-nix-cache-X64-Linux - - uses: actions/download-artifact@v3 - with: - name: magic-nix-cache-ARM64-Linux - path: cache-binary-ARM64-Linux - - name: Persist the cache binary - run: cp ./cache-binary-ARM64-Linux/magic-nix-cache.closure.xz ./artifacts/magic-nix-cache-ARM64-Linux - - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 with: diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml deleted file mode 100644 index 5a2773f..0000000 --- a/.github/workflows/release-tags.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Release Tags - -on: - push: - tags: - - "v*.*.*" - -jobs: - build: - uses: ./.github/workflows/build.yaml - - release: - needs: build - - concurrency: release - runs-on: ubuntu-latest - permissions: - contents: write # In order to upload artifacts to GitHub releases - id-token: write # In order to request a JWT for AWS auth - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Create the artifacts directory - run: rm -rf ./artifacts && mkdir ./artifacts - - - uses: actions/download-artifact@v3 - with: - name: magic-nix-cache-ARM64-macOS - path: cache-binary-ARM64-macOS - - name: Persist the cache binary - run: cp ./cache-binary-ARM64-macOS/magic-nix-cache.closure.xz ./artifacts/magic-nix-cache-ARM64-macOS - - - uses: actions/download-artifact@v3 - with: - name: magic-nix-cache-X64-macOS - path: cache-binary-X64-macOS - - name: Persist the cache binary - run: cp ./cache-binary-X64-macOS/magic-nix-cache.closure.xz ./artifacts/magic-nix-cache-X64-macOS - - - uses: actions/download-artifact@v3 - with: - name: magic-nix-cache-X64-Linux - path: cache-binary-X64-Linux - - name: Persist the cache binary - run: cp ./cache-binary-X64-Linux/magic-nix-cache.closure.xz ./artifacts/magic-nix-cache-X64-Linux - - - uses: actions/download-artifact@v3 - with: - name: magic-nix-cache-ARM64-Linux - path: cache-binary-ARM64-Linux - - name: Persist the cache binary - run: cp ./cache-binary-ARM64-Linux/magic-nix-cache.closure.xz ./artifacts/magic-nix-cache-ARM64-Linux - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ secrets.AWS_S3_UPLOAD_ROLE }} - aws-region: us-east-2 - - name: Publish Release to S3 (Tag) - env: - AWS_BUCKET: ${{ secrets.AWS_S3_UPLOAD_BUCKET }} - run: | - .github/workflows/upload_s3.sh "tag" "$GITHUB_REF_NAME" "$GITHUB_SHA" - - name: Publish Release to GitHub (Tag) - uses: softprops/action-gh-release@v1 - with: - fail_on_unmatched_files: true - draft: true - files: | - artifacts/**