diff options
Diffstat (limited to '.github/workflows/ci.yml')
| -rw-r--r-- | .github/workflows/ci.yml | 76 |
1 files changed, 73 insertions, 3 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68db23e..faa513a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,34 @@ name: CI -on: [push] +on: + push: + branches: [main] + +permissions: + contents: write jobs: - ci: + Check-Codes: + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + + - name: Restore .temp cache + id: cache-temp + uses: actions/cache@v4 + with: + path: .temp + key: ${{ runner.os }}-mingling-temp-${{ hashFiles('Cargo.lock', 'dev_tools/Cargo.toml', 'verified-docs.toml', 'examples/test-examples.toml') }}-${{ hashFiles('dev_tools/src/**/*.rs') }} + restore-keys: | + ${{ runner.os }}-mingling-temp- + + - run: cargo ci --test-codes + + Check-Docs: strategy: matrix: os: [ubuntu-latest, windows-latest] @@ -11,4 +36,49 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 - - run: cargo ci + + - name: Restore .temp cache + id: cache-temp + uses: actions/cache@v4 + with: + path: .temp + key: ${{ runner.os }}-mingling-temp-${{ hashFiles('Cargo.lock', 'dev_tools/Cargo.toml', 'verified-docs.toml', 'examples/test-examples.toml') }}-${{ hashFiles('dev_tools/src/**/*.rs') }} + restore-keys: | + ${{ runner.os }}-mingling-temp- + + - run: cargo ci --test-docs + + Move-Unreleased-Tag: + if: github.ref == 'refs/heads/main' + needs: [Check-Codes, Check-Docs] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - run: | + git tag -f unreleased + git push origin unreleased --force + + Deploy-Github-Pages: + needs: [Move-Unreleased-Tag] + permissions: + contents: read + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: "." + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v5 |
