update github ci test ch2~8 #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ main, master, test ] | |
| pull_request: | |
| branches: [ main, master, test ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| test-ch1: | |
| name: Test Chapter 1 | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/chyyuu/tangram-crates:latest | |
| defaults: | |
| run: | |
| working-directory: tg-rcore-tutorial-ch1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-ch1-cargo-${{ hashFiles('tg-rcore-tutorial-ch1/Cargo.lock') }} | |
| restore-keys: ${{ runner.os }}-ch1-cargo- | |
| - name: Run ch1 tests | |
| run: bash test.sh | |
| test-ch2: | |
| name: Test Chapter 2 | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/chyyuu/tangram-crates:latest | |
| defaults: | |
| run: | |
| working-directory: tg-rcore-tutorial-ch2 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-ch2-cargo-${{ hashFiles('tg-rcore-tutorial-ch2/Cargo.toml') }} | |
| restore-keys: ${{ runner.os }}-ch2-cargo- | |
| - name: Run ch2 tests | |
| run: bash test.sh base | |
| test-ch3: | |
| name: Test Chapter 3 | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/chyyuu/tangram-crates:latest | |
| defaults: | |
| run: | |
| working-directory: tg-rcore-tutorial-ch3 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-ch3-cargo-${{ hashFiles('tg-rcore-tutorial-ch3/Cargo.lock') }} | |
| restore-keys: ${{ runner.os }}-ch3-cargo- | |
| - name: Run ch3 tests | |
| run: bash test.sh base | |
| test-ch4: | |
| name: Test Chapter 4 | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/chyyuu/tangram-crates:latest | |
| defaults: | |
| run: | |
| working-directory: tg-rcore-tutorial-ch4 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-ch4-cargo-${{ hashFiles('tg-rcore-tutorial-ch4/Cargo.toml') }} | |
| restore-keys: ${{ runner.os }}-ch4-cargo- | |
| - name: Run ch4 tests | |
| run: bash test.sh base | |
| test-ch5: | |
| name: Test Chapter 5 | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/chyyuu/tangram-crates:latest | |
| defaults: | |
| run: | |
| working-directory: tg-rcore-tutorial-ch5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-ch5-cargo-${{ hashFiles('tg-rcore-tutorial-ch5/Cargo.toml') }} | |
| restore-keys: ${{ runner.os }}-ch5-cargo- | |
| - name: Run ch5 tests | |
| run: bash test.sh base | |
| test-ch6: | |
| name: Test Chapter 6 | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/chyyuu/tangram-crates:latest | |
| defaults: | |
| run: | |
| working-directory: tg-rcore-tutorial-ch6 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-ch6-cargo-${{ hashFiles('tg-rcore-tutorial-ch6/Cargo.toml') }} | |
| restore-keys: ${{ runner.os }}-ch6-cargo- | |
| - name: Run ch6 tests | |
| run: bash test.sh base | |
| test-ch7: | |
| name: Test Chapter 7 | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/chyyuu/tangram-crates:latest | |
| defaults: | |
| run: | |
| working-directory: tg-rcore-tutorial-ch7 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-ch7-cargo-${{ hashFiles('tg-rcore-tutorial-ch7/Cargo.toml') }} | |
| restore-keys: ${{ runner.os }}-ch7-cargo- | |
| - name: Run ch7 tests | |
| run: bash test.sh base | |
| test-ch8: | |
| name: Test Chapter 8 | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/chyyuu/tangram-crates:latest | |
| defaults: | |
| run: | |
| working-directory: tg-rcore-tutorial-ch8 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-ch8-cargo-${{ hashFiles('tg-rcore-tutorial-ch8/Cargo.toml') }} | |
| restore-keys: ${{ runner.os }}-ch8-cargo- | |
| - name: Run ch8 tests | |
| run: bash test.sh base | |
| all-passed: | |
| name: All Chapters Passed | |
| runs-on: ubuntu-latest | |
| needs: | |
| - test-ch1 | |
| - test-ch2 | |
| - test-ch3 | |
| - test-ch4 | |
| - test-ch5 | |
| - test-ch6 | |
| - test-ch7 | |
| - test-ch8 | |
| steps: | |
| - run: echo "All chapter tests passed!" |