Skip to content

Commit

Permalink
Merge commit '2d09a9f6f22831005c9bce3f8eb39e22beddd167' into support-…
Browse files Browse the repository at this point in the history
…old-rust
  • Loading branch information
eitsupi committed Apr 30, 2023
2 parents ddd2cac + 2d09a9f commit a33eac8
Show file tree
Hide file tree
Showing 245 changed files with 7,950 additions and 4,200 deletions.
12 changes: 7 additions & 5 deletions .devcontainer/base-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
FROM mcr.microsoft.com/devcontainers/rust:0.203.8-1-bullseye
# Some of this is shared with /Dockerfile

FROM mcr.microsoft.com/devcontainers/rust:0.203.11-1-bullseye

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
cmake \
cmake \
&& rm -rf /var/lib/apt/lists/* \
&& sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin

# ========= Install cargo-tools for non-root user (vscode) =========
COPY Taskfile.cargo-tools.yml /tmp/Taskfile.cargo-tools.yml
WORKDIR /tmp
COPY Taskfile.yml /tmp/Taskfile.yml
USER vscode
RUN task -t Taskfile.cargo-tools.yml install

RUN task -t /tmp/Taskfile.yml install-cargo-tools-binstall

USER root
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
},
"mounts": [
{
"source": "devcontainer-cargo-cache",
"target": "/usr/local/cargo",
"source": "devcontainer-cargo-cache-${devcontainerId}",
"target": "/usr/local/cargo/registry",
"type": "volume"
}
],
Expand Down
4 changes: 3 additions & 1 deletion .github/.markdown-link-check.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
],
"ignorePatterns": [
{
"pattern": "^https://twitter.com"
"_comment_1": "Our pipeline should depend only on the work we do.",
"_comment_2": "If some third-party website breaks a link, that should produce a warning, and not block our PRs",
"pattern": "^(?!https://github\\.com/(PRQL|prql)|https://prql-lang\\.org|https://raw\\.githubusercontent\\.com/PRQL).*$"
}
]
}
File renamed without changes.
22 changes: 0 additions & 22 deletions .github/actions/build-prql-js/action.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/actions/build-prql-python/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ runs:
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
key: python
prefix-key: 0.8.1
- uses: messense/maturin-action@v1
if: runner.os == 'Linux'
with:
Expand Down
1 change: 1 addition & 0 deletions .github/actions/time-compilation/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ runs:
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
prefix-key: 0.8.1
# 'true' seems to require quotes (and using `inputs.use_cache` doesn't
# work); I'm really not sure why. There are some issues on the interwebs
# around this, but I couldn't find one that explained it.
Expand Down
9 changes: 0 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,6 @@ updates:
commit-message:
prefix: "chore: "

# For actions (rather than workflows), we need to list each directory, ref
# https://github.com/dependabot/dependabot-core/issues/5137, from https://github.com/dependabot/dependabot-core/issues/4178#issuecomment-1118492006
- directory: ".github/actions/build-prql-js"
commit-message:
prefix: "chore: "
package-ecosystem: "github-actions"
schedule:
interval: "daily"

- directory: ".github/actions/build-prql-python"
commit-message:
prefix: "chore: "
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/build-devcontainer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: build-devcontainer

on:
pull_request:
paths:
- .devcontainer/**
- .github/workflows/build-devcontainer.yaml
- Taskfile.yml
push:
# We could push this on the stable branch (currently named `web`) if we
# needed a clearer release schedule.
# We don't run on every merge to main because:
# - I'm not sure whether starting a new devcontainer pulls a new image every
# time, which would be annoying when there are no changes (maybe it's the
# same but relies on the cache working perfertly)
# - The arm64 build is very very slow, takes 2-3 hours, so we don't want to
# run it excessively.
#
# If the cache works reliably, we can remove this path restriction and run on every merge.
branches:
- main
paths:
- .devcontainer/**
- .github/workflows/build-devcontainer.yaml
- Taskfile.yml
workflow_call:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 3600
steps:
- uses: docker/metadata-action@v4
id: meta
with:
images: ghcr.io/${{ github.repository_owner }}/prql-devcontainer-base
# We could use explicit tags (but mostly we just want the most recent version).
tags: |
type=raw,latest
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build
uses: docker/build-push-action@v4
timeout-minutes: 3600
with:
file: .devcontainer/base-image/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
push:
${{ github.ref == 'refs/heads/main' || startsWith(github.ref,
'refs/tags/') }}
cache-from: |
ghcr.io/${{ github.repository_owner }}/prql-devcontainer-base
type=gha
cache-to: |
type=inline
${{ github.ref_name == 'main' && 'type=gha,mode=max' || '' }}
83 changes: 83 additions & 0 deletions .github/workflows/build-web.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: build-web

on:
pull_request:
paths:
- "web/**"
- ".github/workflows/build-web.yaml"
- "**.md"
workflow_call:

concurrency:
# See notes in `pull-request.yaml`
group: ${{ github.workflow }}-${{ github.ref }}-web
cancel-in-progress: true

jobs:
build-web:
runs-on: ubuntu-latest

# Skip running workflow on forks. Checking the repository owner still allows
# this to be run on PRs, and then below we disable it from attempting to
# publish.
if: github.repository_owner == 'prql'

steps:
- name: 📂 Checkout code
uses: actions/checkout@v3

# Website requires hugo
- name: Setup hugo
uses: peaceiris/actions-hugo@v2.6.0

# Book setup, duplicated from `pull-request.yaml`
- uses: baptiste0928/cargo-install@v2
with:
crate: mdbook
- uses: baptiste0928/cargo-install@v2
with:
crate: mdbook-footnote
- uses: baptiste0928/cargo-install@v2
with:
crate: mdbook-admonish

- uses: baptiste0928/cargo-install@v2
with:
crate: wasm-pack

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"

- name: 💰 Cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: 0.8.1
save-if:
${{ github.ref == 'refs/heads/web' || github.ref ==
'refs/heads/main' }}

- uses: arduino/setup-task@v1
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

- name: 🕷️ Build website
run: task build-web

- uses: actions/upload-pages-artifact@v1.0.8
with:
path: web/website/public/

check-links:
# Copied from `test-all.yaml` — run this for all files (not just changed
# ones) here, since we're more likely to change a location of a file that's
# linked _to_.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
config-file: .github/.markdown-link-check.json
use-quiet-mode: "yes"
67 changes: 0 additions & 67 deletions .github/workflows/devcontainer.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@

# MegaLinter GitHub Action configuration file
# More info at https://megalinter.io
name: MegaLinter
name: lint-megalinter

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_call:

env: # Comment env block if you do not want to apply fixes
# Apply linter fixes configuration
Expand All @@ -25,24 +20,23 @@ concurrency:

jobs:
build:
name: MegaLinter
name: lint-megalinter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to improve performances

# MegaLinter
- name: MegaLinter
- name: lint-megalinte
id: ml
# You can override MegaLinter flavor used to have faster performances
# More info at https://megalinter.io/flavors/
uses: oxsecurity/megalinter@v6
env:
# All available variables are described in documentation
# https://megalinter.io/configuration/
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref
== 'refs/heads/main' }} # Validates all source when push on main, else just the git diff with main. Override with true if you always want to lint all sources
VALIDATE_ALL_CODEBASE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY
# DISABLE: COPYPASTE,SPELL # Uncomment to disable copy-paste and spell checks
Expand All @@ -65,7 +59,7 @@ jobs:
'all' || env.APPLY_FIXES_EVENT == github.event_name) &&
env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push'
|| github.event.pull_request.head.repo.full_name == github.repository)
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
commit-message: "[MegaLinter] Apply linters automatic fixes"
Expand Down
Loading

0 comments on commit a33eac8

Please sign in to comment.